summaryrefslogtreecommitdiff
path: root/src/models/follow-request.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/follow-request.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/follow-request.ts')
-rw-r--r--src/models/follow-request.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/models/follow-request.ts b/src/models/follow-request.ts
index b84fc5f5f5..01d4b8ce6b 100644
--- a/src/models/follow-request.ts
+++ b/src/models/follow-request.ts
@@ -1,6 +1,7 @@
import * as mongo from 'mongodb';
const deepcopy = require('deepcopy');
import db from '../db/mongodb';
+import isObjectId from '../misc/is-objectid';
import { pack as packUser } from './user';
const FollowRequest = db.get<IFollowRequest>('followRequests');
@@ -34,7 +35,7 @@ export async function deleteFollowRequest(followRequest: string | mongo.ObjectID
let f: IFollowRequest;
// Populate
- if (mongo.ObjectID.prototype.isPrototypeOf(followRequest)) {
+ if (isObjectId(followRequest)) {
f = await FollowRequest.findOne({
_id: followRequest
});
@@ -64,7 +65,7 @@ export const pack = (
let _request: any;
// Populate the request if 'request' is ID
- if (mongo.ObjectID.prototype.isPrototypeOf(request)) {
+ if (isObjectId(request)) {
_request = await FollowRequest.findOne({
_id: request
});