From 6cdd464f54fca423876a27ec2a4269ae5841cdb0 Mon Sep 17 00:00:00 2001 From: Romulus Urakagi Tsai Date: Wed, 27 Nov 2019 09:40:19 +0000 Subject: Uploaded done, but uploading not --- models/attachments.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'models/attachments.js') diff --git a/models/attachments.js b/models/attachments.js index 4537e47c..5dcc75e6 100644 --- a/models/attachments.js +++ b/models/attachments.js @@ -2,9 +2,12 @@ import { FilesCollection } from 'meteor/ostrio:files'; Attachments = new FilesCollection({ storagePath: storagePath(), - debug: true, // FIXME: Remove debug mode + debug: false, // FIXME: Remove debug mode collectionName: 'attachments2', allowClientCode: true, // FIXME: Permissions + onAfterUpload: (fileRef) => { + Attachments.update({_id:fileRef._id}, {$set: {"meta.uploaded": true}}); + } }); if (Meteor.isServer) { @@ -15,6 +18,7 @@ if (Meteor.isServer) { // TODO: Permission related // TODO: Add Activity update // TODO: publish and subscribe + Meteor.publish('attachments', function() { return Attachments.find().cursor; }); -- cgit v1.2.3-1-g7c22