swimlanes.js 740 B

12345678910111213141516171819202122232425262728293031323334
  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. if (swimlane && toBoard) {
  9. swimlane.copy(toBoardId);
  10. return true;
  11. }
  12. return false;
  13. },
  14. moveSwimlane(swimlaneId, toBoardId) {
  15. check(swimlaneId, String);
  16. check(toBoardId, String);
  17. const swimlane = ReactiveCache.getSwimlane(swimlaneId);
  18. const toBoard = ReactiveCache.getBoard(toBoardId);
  19. if (swimlane && toBoard) {
  20. swimlane.move(toBoardId);
  21. return true;
  22. }
  23. return false;
  24. },
  25. });