Summary Table
| Categories |
Total Count |
| PII |
0 |
| URL |
0 |
| DNS |
0 |
| EKL |
0 |
| IP |
0 |
| PORT |
0 |
| VsID |
0 |
| CF |
0 |
| AI |
0 |
| VPD |
0 |
| PL |
0 |
| Other |
0 |
File Content
define(['angular', 'app'], function (angular, app) {
'use strict';
app.service('RequestsService', function ($http, $q, localResourceDirectoryService) {
var RequestsService = {};
var requestUrl = localResourceDirectoryService['request-eligibility-criteria'];
var saveOptions = {};
RequestsService.fetch = function(locationId) {
return $http.get(requestUrl.replace('{site-code}', locationId));
};
RequestsService.save = function(data, locationId) {
// update parameters for saving
if(!_.isEmpty(data.link)) {
saveOptions = {
url: data.link[0].href,
method: 'put'
};
} else {
saveOptions = {
url: requestUrl.replace('{site-code}', locationId),
method: 'post'
};
}
return $http[saveOptions.method](saveOptions.url, data);
};
return RequestsService;
});
});