From ba387bcc8464394a57981574887e9eec12e84628 Mon Sep 17 00:00:00 2001 From: DimDz <70445835+DimDz@users.noreply.github.com> Date: Fri, 12 May 2023 09:39:23 +0300 Subject: [PATCH] createCardWithDueDate --- models/cards.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/models/cards.js b/models/cards.js index 1b08d34f4..b3b4acd34 100644 --- a/models/cards.js +++ b/models/cards.js @@ -2943,6 +2943,27 @@ function cardCreation(userId, doc) { }); } +Meteor.methods({ + createCardWithDueDate: function(boardId, listId, title, dueDate, swimlaneId) { + check(boardId, String); + check(listId, String); + check(title, String); + check(dueDate, Date); + check(swimlaneId, String); + const card = { + title, + listId, + boardId, + swimlaneId, + createdAt: new Date(), + dueAt: dueDate, + sort: 0, + }; + const cardId = Cards.insert(card); + return cardId; + }, +}); + function cardRemover(userId, doc) { ChecklistItems.remove({ cardId: doc._id,