From b31d1ce61d0e5779391a7ddf19ab742e20576f81 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 18 Feb 2019 20:52:41 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=95=E3=82=A9=E3=83=AD=E3=83=BC=E3=83=AA?= =?UTF-8?q?=E3=82=AF=E3=82=A8=E3=82=B9=E3=83=88=E6=95=B0=E3=81=8C=E3=81=8A?= =?UTF-8?q?=E3=81=8B=E3=81=97=E3=81=84=E5=A0=B4=E5=90=88=E3=81=AE=E5=BF=9C?= =?UTF-8?q?=E6=80=A5=E5=87=A6=E7=BD=AEAPI=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../i/clear-follow-request-notification.ts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/server/api/endpoints/i/clear-follow-request-notification.ts 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(); +}));