mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-12 03:26:30 +00:00
34 lines
648 B
JavaScript
34 lines
648 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/builds/'+repoName);
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* Gets a build.
|
||
|
*
|
||
|
* @param {string} Name of the repository.
|
||
|
* @param {number} Number of the build.
|
||
|
*/
|
||
|
this.get = function(repoName, buildNumber) {
|
||
|
return $http.get('/api/builds/'+repoName+'/'+buildNumber);
|
||
|
};
|
||
|
}
|
||
|
|
||
|
angular
|
||
|
.module('drone')
|
||
|
.service('builds', BuildService);
|
||
|
})();
|