Attachment upload from card done, need to fix download link

This commit is contained in:
Romulus Urakagi Tsai 2019-11-20 10:40:09 +00:00
parent 05c53ca01d
commit 4dcdec0084
9 changed files with 49 additions and 27 deletions

View file

@ -80,7 +80,7 @@ Migrations.add('lowercase-board-permission', () => {
Migrations.add('change-attachments-type-for-non-images', () => {
const newTypeForNonImage = 'application/octet-stream';
Attachments.find().forEach(file => {
if (!file.isImage()) {
if (!file.isImage) {
Attachments.update(
file._id,
{
@ -97,7 +97,7 @@ Migrations.add('change-attachments-type-for-non-images', () => {
Migrations.add('card-covers', () => {
Cards.find().forEach(card => {
const cover = Attachments.findOne({ cardId: card._id, cover: true });
const cover = Attachments.findOne({ 'meta.cardId': card._id, cover: true });
if (cover) {
Cards.update(card._id, { $set: { coverId: cover._id } }, noValidate);
}