summaryrefslogtreecommitdiff
path: root/src/models/note-watching.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-10-16 11:38:09 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-10-16 11:38:09 +0900
commit9427a756c9e4a1d95210ccfca56fdb67d62183ec (patch)
tree667cf5f4d6ecf80d0e3a22c4085a410537d1dc9d /src/models/note-watching.ts
parentfix(package): update @types/node to version 10.12.0 (#2912) (diff)
downloadmisskey-9427a756c9e4a1d95210ccfca56fdb67d62183ec.tar.gz
misskey-9427a756c9e4a1d95210ccfca56fdb67d62183ec.tar.bz2
misskey-9427a756c9e4a1d95210ccfca56fdb67d62183ec.zip
Update mongodb
Diffstat (limited to 'src/models/note-watching.ts')
-rw-r--r--src/models/note-watching.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/models/note-watching.ts b/src/models/note-watching.ts
index 479f92dd44..ae576907bc 100644
--- a/src/models/note-watching.ts
+++ b/src/models/note-watching.ts
@@ -1,5 +1,6 @@
import * as mongo from 'mongodb';
import db from '../db/mongodb';
+import isObjectId from '../misc/is-objectid';
const NoteWatching = db.get<INoteWatching>('noteWatching');
NoteWatching.createIndex(['userId', 'noteId'], { unique: true });
@@ -19,7 +20,7 @@ export async function deleteNoteWatching(noteWatching: string | mongo.ObjectID |
let n: INoteWatching;
// Populate
- if (mongo.ObjectID.prototype.isPrototypeOf(noteWatching)) {
+ if (isObjectId(noteWatching)) {
n = await NoteWatching.findOne({
_id: noteWatching
});