mirror of
https://github.com/paricafe/misskey.git
synced 2024-12-02 14:06:43 -06:00
b9cb6d1c10
将来ESMに移行しやすいように Related: #7658 なんかmochaが起動しなくなってるけど理由不明 すぐ直したい
24 lines
573 B
TypeScript
24 lines
573 B
TypeScript
import { publishMainStream } from '@/services/stream.js';
|
|
import define from '../../define.js';
|
|
import { Notifications } from '@/models/index.js';
|
|
|
|
export const meta = {
|
|
tags: ['notifications', 'account'],
|
|
|
|
requireCredential: true as const,
|
|
|
|
kind: 'write:notifications'
|
|
};
|
|
|
|
export default define(meta, async (ps, user) => {
|
|
// Update documents
|
|
await Notifications.update({
|
|
notifieeId: user.id,
|
|
isRead: false,
|
|
}, {
|
|
isRead: true
|
|
});
|
|
|
|
// 全ての通知を読みましたよというイベントを発行
|
|
publishMainStream(user.id, 'readAllNotifications');
|
|
});
|