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

Commit

Permalink
fix(cloud.project.flavor): add clear cache and clear query cache meth…
Browse files Browse the repository at this point in the history
…ods (#143)

ref: MBP-329
  • Loading branch information
varun257 authored and antleblanc committed Mar 12, 2019
1 parent 8241384 commit 1f9a045
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/cloud/project/flavor/cloud-project-flavor.v6.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ angular.module("ovh-api-services").service("OvhApiCloudProjectFlavorV6", functio
"use strict";

var cache = $cacheFactory("OvhApiCloudProjectFlavorV6");
var queryCache = $cacheFactory("OvhApiCloudProjectFlavorV6Query");

return $resource("/cloud/project/:serviceName/flavor/:flavorId", {
var flavor = $resource("/cloud/project/:serviceName/flavor/:flavorId", {
serviceName: "@serviceName",
flavorId: "@flavorId"
}, {
Expand All @@ -23,7 +24,7 @@ angular.module("ovh-api-services").service("OvhApiCloudProjectFlavorV6", functio
},
query: {
method: "GET",
cache: cache,
cache: queryCache,
isArray: true,
queryParams: {
region: "@region"
Expand All @@ -48,4 +49,14 @@ angular.module("ovh-api-services").service("OvhApiCloudProjectFlavorV6", functio
}
}
});

flavor.resetCache = function () {
cache.removeAll();
};

flavor.resetQueryCache = function () {
queryCache.removeAll();
};

return flavor;
});

0 comments on commit 1f9a045

Please sign in to comment.