You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/services/api/dockerhubService.js

27 lines
680 B

angular.module('portainer.services')
.factory('DockerHubService', ['$q', 'DockerHub', function DockerHubServiceFactory($q, DockerHub) {
'use strict';
var service = {};
service.dockerhub = function() {
var deferred = $q.defer();
DockerHub.get().$promise
.then(function success(data) {
var dockerhub = new DockerHubViewModel(data);
deferred.resolve(dockerhub);
})
.catch(function error(err) {
deferred.reject({ msg: 'Unable to retrieve DockerHub details', err: err });
});
return deferred.promise;
};
service.update = function(dockerhub) {
return DockerHub.update({}, dockerhub).$promise;
};
return service;
}]);