mirror of
https://github.com/Febbweiss/ProjectDeployer.git
synced 2026-03-05 06:35:42 +00:00
Refactoring: reorganize files between client and server + initiate deployment
This commit is contained in:
37
server/lib/projects.service.js
Normal file
37
server/lib/projects.service.js
Normal file
@@ -0,0 +1,37 @@
|
||||
Projects = new Mongo.Collection('projects');
|
||||
|
||||
ProjectService = {
|
||||
insert: function(label, git_url, public_url, commands, callback) {
|
||||
Projects.insert({
|
||||
label: label,
|
||||
git_url: git_url,
|
||||
public_url: public_url,
|
||||
commands: commands
|
||||
}, callback);
|
||||
},
|
||||
|
||||
update: function(id, label, git_url, public_url ,commands) {
|
||||
Projects.update(
|
||||
id,
|
||||
{ $set: {
|
||||
label: label,
|
||||
git_url: git_url,
|
||||
public_url: public_url,
|
||||
commands: commands
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
delete: function(id) {
|
||||
Projects.remove(id);
|
||||
},
|
||||
|
||||
get: function(id) {
|
||||
return Projects.findOne({_id: id});
|
||||
},
|
||||
|
||||
list: function() {
|
||||
return Projects.find({}, {sort: {label: 1}});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user