blob: 16f4f19c7f1bdd7202b3d15df70d64e795cfdd24 [file] [log] [blame]
(function () {
angular.module('mCord')
.service('Imsi', function($resource, $q, $http, baseUrl){
const r = $resource(`${baseUrl}api/imsi/:id`, {id: '@id'}, {
save: {method: 'PUT'}
});
r.prototype.getProfiles = function(){
const d = $q.defer();
$http.get(`${baseUrl}api/imsi/${this.IMSI}/profile`)
.then(res => {
d.resolve(res.data);
})
.catch(err => {
d.reject(err)
});
return d.promise;
};
r.prototype.deleteProfile = function(id){
const d = $q.defer();
$http.delete(`${baseUrl}api/imsi/${this.IMSI}/profile/${id}`)
.then(res => {
d.resolve(res.data);
})
.catch(err => {
d.reject(err)
});
return d.promise;
};
return r;
})
})();