Assign user to attachment before inserting

pull/1202/head
Ghassen Rjab 8 years ago
parent ad09630d4e
commit 4ad4c6ea22
  1. 3
      client/components/cards/attachments.js
  2. 1
      models/trelloCreator.js
  3. 2
      models/wekanCreator.js

@ -62,7 +62,7 @@ Template.cardAttachmentsPopup.events({
const file = new FS.File(f); const file = new FS.File(f);
file.boardId = card.boardId; file.boardId = card.boardId;
file.cardId = card._id; file.cardId = card._id;
file.userId = Meteor.userId();
Attachments.insert(file); Attachments.insert(file);
Popup.close(); Popup.close();
}); });
@ -109,6 +109,7 @@ Template.previewClipboardImagePopup.events({
file.updatedAt(new Date()); file.updatedAt(new Date());
file.boardId = card.boardId; file.boardId = card.boardId;
file.cardId = card._id; file.cardId = card._id;
file.userId = Meteor.userId();
Attachments.insert(file); Attachments.insert(file);
pastedResults = null; pastedResults = null;
$(document.body).pasteImageReader(() => {}); $(document.body).pasteImageReader(() => {});

@ -322,6 +322,7 @@ export class TrelloCreator {
file.attachData(att.url, function (error) { file.attachData(att.url, function (error) {
file.boardId = boardId; file.boardId = boardId;
file.cardId = cardId; file.cardId = cardId;
file.userId = this._user(att.idMemberCreator);
if (error) { if (error) {
throw(error); throw(error);
} else { } else {

@ -312,6 +312,7 @@ export class WekanCreator {
file.attachData(att.url, function (error) { file.attachData(att.url, function (error) {
file.boardId = boardId; file.boardId = boardId;
file.cardId = cardId; file.cardId = cardId;
file.userId = this._user(att.userId);
if (error) { if (error) {
throw(error); throw(error);
} else { } else {
@ -330,6 +331,7 @@ export class WekanCreator {
file.name(att.name); file.name(att.name);
file.boardId = boardId; file.boardId = boardId;
file.cardId = cardId; file.cardId = cardId;
file.userId = this._user(att.userId);
if (error) { if (error) {
throw(error); throw(error);
} else { } else {

Loading…
Cancel
Save