Fix bug: Check following request existance

This commit is contained in:
syuilo
2018-08-23 14:56:39 +09:00
parent 37865cb381
commit e31a2f7e55
2 changed files with 14 additions and 1 deletions

View File

@ -27,7 +27,11 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) =
return rej('followee not found');
}
await cancelFollowRequest(followee, user);
try {
await cancelFollowRequest(followee, user);
} catch (e) {
return rej(e);
}
// Send response
res(await pack(followee._id, user));