Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

Commit

Permalink
fix(support): add interceptor for POST calls
Browse files Browse the repository at this point in the history
  • Loading branch information
FredericEspiau authored and antleblanc committed Jul 25, 2019
1 parent 829f2c4 commit 9b038e4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/support/support.v6.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ angular.module("ovh-api-services").service("OvhApiSupportV6", function ($resourc
var cache = $cacheFactory("OvhApiSupportV6");
var queryCache = $cacheFactory("OvhApiSupportV6Query");

var interceptor = {
response: function (response) {
cache.removeAll();
queryCache.removeAll();
return response;
}
};

var support = $resource("/support/tickets/:id", {
id: "@id"
}, {
Expand All @@ -17,19 +25,23 @@ angular.module("ovh-api-services").service("OvhApiSupportV6", function ($resourc
isArray: true
},
create: {
interceptor: interceptor,
method: "POST",
url: "/support/tickets/:id/create"
},
close: {
hasBody: false,
interceptor: interceptor,
method: "POST",
url: "/support/tickets/:id/close"
},
reopen: {
interceptor: interceptor,
method: "POST",
url: "/support/tickets/:id/reopen"
},
reply: {
interceptor: interceptor,
method: "POST",
url: "/support/tickets/:id/reply"
}
Expand Down

0 comments on commit 9b038e4

Please sign in to comment.