From b70e107b1816a7ac58e263738d5c015ddf299877 Mon Sep 17 00:00:00 2001 From: Jonathan Cremin Date: Tue, 1 Sep 2015 14:15:00 +0200 Subject: [PATCH] Fix objectId case --- api/routes/file.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/api/routes/file.js b/api/routes/file.js index 20b92db..7181bd4 100644 --- a/api/routes/file.js +++ b/api/routes/file.js @@ -248,8 +248,7 @@ export function* put() { export function* del() { - const Files = this.db.Files; - yield Files.updateOne({'_id': this.params.id, owner: this.db.ObjectId(this.user.id)}, {$set: {status: 'deleted'}}, {w: 1}); + yield this.db.Files.updateOne({'_id': this.params.id, owner: this.db.objectId(this.user.id)}, {$set: {status: 'deleted'}}, {w: 1}); const event = {type: 'file-deleted', data: {'id': this.params.id}}; yield this.redis.publish('/user/' + this.user.id, JSON.stringify(event)); yield this.redis.publish('/file/' + this.params.id, JSON.stringify(event));