1
0

projects.methods.js 842 B

123456789101112131415161718192021222324252627282930313233
  1. Meteor.methods({
  2. listProjects: function() {
  3. return ProjectService.list();
  4. },
  5. getProject: function(id) {
  6. return ProjectService.get(id);
  7. },
  8. addProject: function(label, git_url, public_url ,commands) {
  9. return ProjectService.insert(label, git_url, public_url ,commands, function(errors, id) {
  10. if( id ) {
  11. DeploymentService.create(ProjectService.get(id));
  12. }
  13. });
  14. },
  15. editProject: function(id, label, git_url, public_url ,commands) {
  16. ProjectService.update(id, label, git_url, public_url ,commands, function(errors, updated_count) {
  17. if( updated_count ) {
  18. DeploymentService.update(id);
  19. }
  20. });
  21. },
  22. deleteProject: function(id) {
  23. ProjectService.delete(id, function(errors) {
  24. if( ! errors ) {
  25. DeploymentService.delete(id);
  26. }
  27. });
  28. }
  29. });