diff --git a/src/server/api/endpoints/i/clear-follow-request-notification.ts b/src/server/api/endpoints/i/clear-follow-request-notification.ts new file mode 100644 index 000000000..af4302621 --- /dev/null +++ b/src/server/api/endpoints/i/clear-follow-request-notification.ts @@ -0,0 +1,21 @@ +import User from '../../../../models/user'; +import define from '../../define'; + +export const meta = { + requireCredential: true, + + kind: 'account-write', + + params: { + } +}; + +export default define(meta, (ps, user) => new Promise(async (res, rej) => { + await User.update({ _id: user._id }, { + $set: { + pendingReceivedFollowRequestsCount: 0 + } + }); + + res(); +}));