woodpecker/server/static/scripts/services/builds.js
2015-04-14 22:04:38 -07:00

34 lines
664 B
JavaScript

'use strict';
(function () {
/**
* The BuildsService provides access to build
* data using REST API calls.
*/
function BuildService($http, $window) {
/**
* Gets a list of builds.
*
* @param {string} Name of the repository.
*/
this.list = function(repoName) {
return $http.get('/api/repos/'+repoName+'/builds');
};
/**
* Gets a build.
*
* @param {string} Name of the repository.
* @param {number} Number of the build.
*/
this.get = function(repoName, buildNumber) {
return $http.get('/api/repos/'+repoName+'/builds/'+buildNumber);
};
}
angular
.module('drone')
.service('builds', BuildService);
})();