mirror of
https://github.com/misskey-dev/misskey
synced 2024-05-24 04:10:11 +02:00
16 lines
482 B
TypeScript
16 lines
482 B
TypeScript
//import $ from 'cafy'; import ID from '../../../../../cafy-id';
|
|
import FollowRequest, { pack } from '../../../../../models/follow-request';
|
|
import { ILocalUser } from '../../../../../models/user';
|
|
|
|
/**
|
|
* Get all pending received follow requests
|
|
*/
|
|
module.exports = (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
|
const reqs = await FollowRequest.find({
|
|
followeeId: user._id
|
|
});
|
|
|
|
// Send response
|
|
res(await Promise.all(reqs.map(req => pack(req))));
|
|
});
|