This commit is contained in:
syuilo
2018-06-02 00:51:20 +09:00
parent f14571dc42
commit a26c19cbd2
5 changed files with 97 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
//import $ from 'cafy'; import ID from '../../../../../cafy-id';
import FollowRequest, { pack } from '../../../../../models/follow-request';
/**
* Get all pending received follow requests
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
const reqs = await FollowRequest.find({
followeeId: user._id
});
// Send response
res(await Promise.all(reqs.map(req => pack(req))));
});