mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-25 14:25:45 +01:00
23 lines
447 B
JavaScript
23 lines
447 B
JavaScript
define([
|
|
'app',
|
|
'factories/job'
|
|
], function(app) {
|
|
app.registerService('jobs', ['$http', 'Job', function($http, Job) {
|
|
var self = this;
|
|
|
|
self.get = function(playbook, cb) {
|
|
$http.get('/playbook/'+playbook.data._id+'/jobs').success(function(data) {
|
|
self.jobs = [];
|
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
var job = new Job();
|
|
job.data = data[i];
|
|
|
|
self.jobs.push(job);
|
|
}
|
|
|
|
cb();
|
|
});
|
|
}
|
|
}]);
|
|
}); |