* Update api document in admin/announcements * Update api document in announcements * Update api document in i/read-announcements * Update api document in username/available * Update api document & Fix typo in API 403 error * Update api document * Update api document * Update api document * Fix API permission definition * Update api document * Update api document * Update api document * Update api document * Update api document * Update api document * Update api document * Update api document * Fix bug in users (api) * Apply reviews #6757 * Apply reviews #6757 Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
49 lines
1.1 KiB
TypeScript
49 lines
1.1 KiB
TypeScript
import define from '../../../define';
|
|
import { FollowRequests } from '../../../../../models';
|
|
|
|
export const meta = {
|
|
desc: {
|
|
'ja-JP': '自分に届いたフォローリクエストの一覧を取得します。',
|
|
'en-US': 'Get all pending received follow requests.'
|
|
},
|
|
|
|
tags: ['following', 'account'],
|
|
|
|
requireCredential: true as const,
|
|
|
|
kind: 'read:following',
|
|
|
|
res: {
|
|
type: 'array' as const,
|
|
optional: false as const, nullable: false as const,
|
|
items: {
|
|
type: 'object' as const,
|
|
optional: false as const, nullable: false as const,
|
|
properties: {
|
|
id: {
|
|
type: 'string' as const,
|
|
optional: false as const, nullable: false as const,
|
|
format: 'id'
|
|
},
|
|
follower: {
|
|
type: 'object' as const,
|
|
optional: false as const, nullable: false as const,
|
|
ref: 'User'
|
|
},
|
|
followee: {
|
|
type: 'object' as const,
|
|
optional: false as const, nullable: false as const,
|
|
ref: 'User'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
|
|
export default define(meta, async (ps, user) => {
|
|
const reqs = await FollowRequests.find({
|
|
followeeId: user.id
|
|
});
|
|
|
|
return await Promise.all(reqs.map(req => FollowRequests.pack(req)));
|
|
});
|