This commit is contained in:
tamaina 2021-01-28 03:24:32 +09:00
parent 5ca4aefff4
commit 1c472d2210
8 changed files with 214 additions and 64 deletions

View file

@ -0,0 +1,30 @@
import $ from 'cafy';
import { ID } from '../../../../misc/cafy-id';
import { publishMainStream } from '../../../../services/stream';
import define from '../../define';
import { readNotification } from '../../common/read-notification';
export const meta = {
desc: {
'ja-JP': '通知を既読にします。',
'en-US': 'Mark a notification as read.'
},
tags: ['notifications', 'account'],
requireCredential: true as const,
params: {
notificationIds: {
validator: $.arr($.type(ID)),
desc: {
'ja-JP': '対象の通知のIDの配列',
'en-US': 'Target notification IDs.'
}
}
},
kind: 'write:notifications'
};
export default define(meta, async (ps, user) => readNotification(user.id, ps.notificationIds));