From fc3819d6364631fdfae402e52283b5acffbd4f71 Mon Sep 17 00:00:00 2001 From: Stephanie Moallic Date: Mon, 19 Aug 2019 09:53:51 +0200 Subject: [PATCH 1/6] feat(xdsl.modem.exchange): add call for comfort exchange Ref: UXCT-187 --- src/api/xdsl/modem/xdsl-modem.v6.service.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/api/xdsl/modem/xdsl-modem.v6.service.js b/src/api/xdsl/modem/xdsl-modem.v6.service.js index 5ca01215..8f92fdd0 100644 --- a/src/api/xdsl/modem/xdsl-modem.v6.service.js +++ b/src/api/xdsl/modem/xdsl-modem.v6.service.js @@ -21,6 +21,11 @@ angular.module('ovh-api-services').service('OvhApiXdslModemV6', ($resource, OvhA method: 'POST', url: '/xdsl/:xdslId/modem/reconfigureVoip', interceptor, + }, + exchangeModem: { + method: 'POST', + url: '/xdsl/:xdslId/modem/comfortExchange', + interceptor, } }); }); From 19912f3c1fd966e61636ac9a9480a29a282601d1 Mon Sep 17 00:00:00 2001 From: Stephanie Moallic Date: Mon, 19 Aug 2019 10:48:24 +0200 Subject: [PATCH 2/6] feat(xdsl.modem.exchange): rename call api --- src/api/xdsl/modem/xdsl-modem.v6.service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/xdsl/modem/xdsl-modem.v6.service.js b/src/api/xdsl/modem/xdsl-modem.v6.service.js index 8f92fdd0..754646f2 100644 --- a/src/api/xdsl/modem/xdsl-modem.v6.service.js +++ b/src/api/xdsl/modem/xdsl-modem.v6.service.js @@ -22,7 +22,7 @@ angular.module('ovh-api-services').service('OvhApiXdslModemV6', ($resource, OvhA url: '/xdsl/:xdslId/modem/reconfigureVoip', interceptor, }, - exchangeModem: { + comfortExchange: { method: 'POST', url: '/xdsl/:xdslId/modem/comfortExchange', interceptor, From 90ad0b8b4388653f01c5c75c79a110b525ff2eb4 Mon Sep 17 00:00:00 2001 From: Stephanie Moallic Date: Wed, 21 Aug 2019 11:42:44 +0200 Subject: [PATCH 3/6] feat(xdsl.exchange): add rma call api --- src/api/xdsl/rma/xdsl-rma.service.js | 5 +++ src/api/xdsl/rma/xdsl-rma.v6.service.js | 48 +++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 src/api/xdsl/rma/xdsl-rma.service.js create mode 100644 src/api/xdsl/rma/xdsl-rma.v6.service.js diff --git a/src/api/xdsl/rma/xdsl-rma.service.js b/src/api/xdsl/rma/xdsl-rma.service.js new file mode 100644 index 00000000..cc0ea712 --- /dev/null +++ b/src/api/xdsl/rma/xdsl-rma.service.js @@ -0,0 +1,5 @@ +angular.module('ovh-api-services').service('OvhApiXdslRMA', $injector => ({ + v6() { + return $injector.get('OvhApiXdslRMAV6'); + }, +})); diff --git a/src/api/xdsl/rma/xdsl-rma.v6.service.js b/src/api/xdsl/rma/xdsl-rma.v6.service.js new file mode 100644 index 00000000..64cb3bd7 --- /dev/null +++ b/src/api/xdsl/rma/xdsl-rma.v6.service.js @@ -0,0 +1,48 @@ +angular.module('ovh-api-services').service('OvhApiXdslRMAV6', ($resource, $cacheFactory) => { + const cache = $cacheFactory('OvhApiXdslRMAV6'); + const queryCache = $cacheFactory('OvhApiXdslRMAV6Query'); + + const interceptor = { + response(response) { + cache.remove(response.config.url); + queryCache.removeAll(); + return response.resource; + }, + }; + + const resource = $resource('/xdsl/:xdslId/rma', { + xdslId: '@xdslId', + id: '@id' + }, { + query: { + method: 'GET', + isArray: true, + cache: queryCache, + }, + get: { + method: 'GET', + cache, + }, + getRMA: { + method: 'GET', + url: '/xdsl/:xdslId/rma/:id', + }, + updateRMA: { + method: 'PUT', + url: '/xdsl/:xdslId/rma/:id', + interceptor, + }, + deleteRMA: { + method: 'DELETE', + url: '/xdsl/:xdslId/rma/:id', + interceptor; + }, + }); + + resource.resetAllCache = function () { + cache.removeAll(); + queryCache.removeAll(); + }; + + return resource; +}); From e7d5feeff3847437b8d3ce408cc50e174d0c3f4a Mon Sep 17 00:00:00 2001 From: Stephanie Moallic Date: Wed, 21 Aug 2019 11:45:24 +0200 Subject: [PATCH 4/6] feat(xdsl.rma): add call api for rma --- src/api/xdsl/xdsl.service.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/api/xdsl/xdsl.service.js b/src/api/xdsl/xdsl.service.js index fd33f28e..005cc179 100644 --- a/src/api/xdsl/xdsl.service.js +++ b/src/api/xdsl/xdsl.service.js @@ -29,6 +29,9 @@ angular.module('ovh-api-services').service('OvhApiXdsl', ($injector, $cacheFacto Spare() { return $injector.get('OvhApiXdslSpare'); }, + RMA() { + return $injector.get('OvhApiXdslRMA'); + }, resetCache: cache.removeAll, cache, }; From 2121a037817e0283239998adfb76ed527e1d1129 Mon Sep 17 00:00:00 2001 From: Stephanie Moallic Date: Wed, 21 Aug 2019 12:06:44 +0200 Subject: [PATCH 5/6] feat(xdsl.rma): resolve error --- src/api/xdsl/rma/xdsl-rma.v6.service.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/xdsl/rma/xdsl-rma.v6.service.js b/src/api/xdsl/rma/xdsl-rma.v6.service.js index 64cb3bd7..4030cbc6 100644 --- a/src/api/xdsl/rma/xdsl-rma.v6.service.js +++ b/src/api/xdsl/rma/xdsl-rma.v6.service.js @@ -12,7 +12,7 @@ angular.module('ovh-api-services').service('OvhApiXdslRMAV6', ($resource, $cache const resource = $resource('/xdsl/:xdslId/rma', { xdslId: '@xdslId', - id: '@id' + id: '@id', }, { query: { method: 'GET', @@ -35,7 +35,7 @@ angular.module('ovh-api-services').service('OvhApiXdslRMAV6', ($resource, $cache deleteRMA: { method: 'DELETE', url: '/xdsl/:xdslId/rma/:id', - interceptor; + interceptor, }, }); From 8b1a0d8f5ed3d5cc3c5e2c3f9f886b4e15d5fa6f Mon Sep 17 00:00:00 2001 From: Stephanie Moallic Date: Fri, 23 Aug 2019 14:02:39 +0200 Subject: [PATCH 6/6] feat(xdsl.rma): update url and cache for rma --- src/api/xdsl/rma/xdsl-rma.v6.service.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/api/xdsl/rma/xdsl-rma.v6.service.js b/src/api/xdsl/rma/xdsl-rma.v6.service.js index 4030cbc6..83e173ae 100644 --- a/src/api/xdsl/rma/xdsl-rma.v6.service.js +++ b/src/api/xdsl/rma/xdsl-rma.v6.service.js @@ -10,7 +10,7 @@ angular.module('ovh-api-services').service('OvhApiXdslRMAV6', ($resource, $cache }, }; - const resource = $resource('/xdsl/:xdslId/rma', { + const resource = $resource('/xdsl/:xdslId/rma/:id', { xdslId: '@xdslId', id: '@id', }, { @@ -21,20 +21,13 @@ angular.module('ovh-api-services').service('OvhApiXdslRMAV6', ($resource, $cache }, get: { method: 'GET', - cache, }, - getRMA: { - method: 'GET', - url: '/xdsl/:xdslId/rma/:id', - }, - updateRMA: { + update: { method: 'PUT', - url: '/xdsl/:xdslId/rma/:id', interceptor, }, - deleteRMA: { + delete: { method: 'DELETE', - url: '/xdsl/:xdslId/rma/:id', interceptor, }, });