瀏覽代碼

Assign user to attachment before inserting

Ghassen Rjab 7 年之前
父節點
當前提交
4ad4c6ea22
共有 3 個文件被更改,包括 5 次插入1 次删除
  1. 2 1
      client/components/cards/attachments.js
  2. 1 0
      models/trelloCreator.js
  3. 2 0
      models/wekanCreator.js

+ 2 - 1
client/components/cards/attachments.js

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

+ 1 - 0
models/trelloCreator.js

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

+ 2 - 0
models/wekanCreator.js

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