swimlanes.js 776 B

123456789101112131415161718192021222324252627282930313233343536
  1. import { ReactiveCache } from '/imports/reactiveCache';
  2. Meteor.methods({
  3. copySwimlane(swimlaneId, toBoardId) {
  4. check(swimlaneId, String);
  5. check(toBoardId, String);
  6. const swimlane = ReactiveCache.getSwimlane(swimlaneId);
  7. const toBoard = ReactiveCache.getBoard(toBoardId);
  8. let ret = false;
  9. if (swimlane && toBoard) {
  10. swimlane.copy(toBoardId);
  11. ret = true;
  12. }
  13. return ret;
  14. },
  15. moveSwimlane(swimlaneId, toBoardId) {
  16. check(swimlaneId, String);
  17. check(toBoardId, String);
  18. const swimlane = ReactiveCache.getSwimlane(swimlaneId);
  19. const toBoard = ReactiveCache.getBoard(toBoardId);
  20. let ret = false;
  21. if (swimlane && toBoard) {
  22. swimlane.move(toBoardId);
  23. ret = true;
  24. }
  25. return ret;
  26. },
  27. });