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

Commit

Permalink
feat(xdsl.meetings): add endpoints to retrieve and select meeting
Browse files Browse the repository at this point in the history
Signed-off-by: Stephanie Moallic <[email protected]>
  • Loading branch information
Stephanie Moallic committed Aug 6, 2020
1 parent d37f01d commit 77f82be
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions src/api/xdsl/xdsl.v6.service.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
angular.module('ovh-api-services').service('OvhApiXdslV6', ($resource, OvhApiXdsl, OvhApiTelecomSidebar) => {
angular.module('ovh-api-services').service('OvhApiXdslV6', ($resource, OvhApiXdsl, OvhApiTelecomSidebar, Poller) => {
const interceptor = {
response(response) {
OvhApiTelecomSidebar.resetCache();
Expand All @@ -7,7 +7,7 @@ angular.module('ovh-api-services').service('OvhApiXdslV6', ($resource, OvhApiXds
},
};

return $resource(
const xdsl = $resource(
'/xdsl/:xdslId', {
xdslId: '@id',
}, {
Expand Down Expand Up @@ -82,6 +82,38 @@ angular.module('ovh-api-services').service('OvhApiXdslV6', ($resource, OvhApiXds
method: 'POST',
url: '/xdsl/:xdslId/applyTemplateToModem',
},
orderMeeting: {
method: 'POST',
url: '/xdsl/:xdslId/orderMeeting',
interceptor,
},
},
);

xdsl.searchOrderMeetings = function ($scope, opts) {
const url = `/xdsl/${opts.serviceName}/searchOrderMeetings`;

$scope.$on('$destroy', () => {
Poller.kill({
scope: $scope.$id,
});
});

return Poller.poll(
url,
null,
{
successRule: {
status(elem) {
return elem.status === 'error' || elem.status === 'ok';
},
},
scope: $scope.$id,
method: 'POST',
retryMaxAttempts: 3,
},
);
};

return xdsl;
});

0 comments on commit 77f82be

Please sign in to comment.