wip
This commit is contained in:
14
src/server/api/endpoints/following/requests/list.ts
Normal file
14
src/server/api/endpoints/following/requests/list.ts
Normal 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))));
|
||||
});
|
||||
Reference in New Issue
Block a user