Improves album directives
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
var services = angular.module('satbd.satellite.bar.services',[])
|
||||
|
||||
services.factory('albumService',['$http','$log','$q', function($http,$log,$q) {
|
||||
function cleanupFields(album) {
|
||||
album.serie = album.série;
|
||||
return album;
|
||||
}
|
||||
function get(id) {
|
||||
return $http.get('/api/albums/'+ id).then(function (response) {
|
||||
return response.data;
|
||||
return cleanupFields(response.data);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -12,7 +16,7 @@ services.factory('albumService',['$http','$log','$q', function($http,$log,$q) {
|
||||
defer.reject('Search is not implemented');
|
||||
return defer.promise;
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
get: get,
|
||||
search: search
|
||||
|
||||
Reference in New Issue
Block a user