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

Commit

Permalink
feat(connectivity): add eligibility endpoints for partners (#321)
Browse files Browse the repository at this point in the history
Add:
- testAddressPartners
- testLinePartners

Signed-off-by: Stephanie Moallic <[email protected]>
  • Loading branch information
Steffy29 authored Apr 6, 2021
1 parent 7275781 commit f09c816
Showing 1 changed file with 60 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,65 @@ angular.module('ovh-api-services').service('OvhApiConnectivityEligibilityV6', ($
);
};

// Only for partners
eligibility.testAddressPartners = function ($scope, opts) {
const url = '/connectivity/eligibility/test/address/partners';

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

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

// Only for partners
eligibility.testLinePartners = function ($scope, opts) {
const url = '/connectivity/eligibility/test/line/partners';

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

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

return eligibility;
});

0 comments on commit f09c816

Please sign in to comment.