Merge pull request #4923 from DimDz/master

Fix for the Create Card at Calendar
This commit is contained in:
Lauri Ojansivu 2023-05-12 17:05:44 +03:00 committed by GitHub
commit 2d683ea198
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View file

@ -328,6 +328,7 @@ BlazeComponent.extendComponent({
id: 'calendar-view',
defaultView: 'agendaDay',
editable: true,
selecatble: true,
timezone: 'local',
weekNumbers: true,
header: {

View file

@ -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,