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

Commit

Permalink
feat(pack.xdsl.move): add moveOffer endpoint
Browse files Browse the repository at this point in the history
ref: UXCT-193

Signed-off-by: Antoine Leblanc <[email protected]>
Co-authored-by: Stephanie Moallic <[email protected]>
  • Loading branch information
antleblanc and Stephanie Moallic committed Jun 16, 2020
1 parent 253aa41 commit 041fdb1
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion src/api/pack/xdsl/move/pack-xdsl-move.v6.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ angular.module('ovh-api-services').service('OvhApiPackXdslMoveV6', ($resource, P
url: '/pack/xdsl/:packName/addressMove/move',
isArray: false,
},
moveOffer: {
method: 'POST',
url: '/pack/xdsl/:packName/addressMove/moveOffer',
isArray: false,
},
});

move.pollElligibility = function ($scope, opts) {
const url = ['/pack/xdsl/', opts.packName, '/addressMove/eligibility'].join('');
const url = `/pack/xdsl/${opts.packName}/addressMove/eligibility`;

$scope.$on('$destroy', () => {
Poller.kill({
Expand Down Expand Up @@ -38,5 +43,33 @@ angular.module('ovh-api-services').service('OvhApiPackXdslMoveV6', ($resource, P
);
};

move.pollOffers = function ($scope, opts) {
const url = `/pack/xdsl/${opts.packName}/addressMove/offers`;

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

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

return move;
});

0 comments on commit 041fdb1

Please sign in to comment.