diff options
| author | かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> | 2023-09-11 14:31:50 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-11 14:31:50 +0900 |
| commit | cd6428715e6780d51e8f6edf93fe7e32bd8f937b (patch) | |
| tree | 3a1ac5a3f7d01f4fa1fbcb29af7c5bd9df0d6581 /packages/backend/src/server/api/endpoints/notifications | |
| parent | fix (diff) | |
| download | sharkey-cd6428715e6780d51e8f6edf93fe7e32bd8f937b.tar.gz sharkey-cd6428715e6780d51e8f6edf93fe7e32bd8f937b.tar.bz2 sharkey-cd6428715e6780d51e8f6edf93fe7e32bd8f937b.zip | |
feat: テスト通知を送信できるようにする (#11810)
* (add) Notification test
* Update Changelog
* (add) backend, frontend impl
* globalEventの名前を明確にする
* Run API Extractor
Diffstat (limited to 'packages/backend/src/server/api/endpoints/notifications')
| -rw-r--r-- | packages/backend/src/server/api/endpoints/notifications/test-notification.ts | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/packages/backend/src/server/api/endpoints/notifications/test-notification.ts b/packages/backend/src/server/api/endpoints/notifications/test-notification.ts new file mode 100644 index 0000000000..04a68a8054 --- /dev/null +++ b/packages/backend/src/server/api/endpoints/notifications/test-notification.ts @@ -0,0 +1,33 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { Injectable } from '@nestjs/common'; +import { Endpoint } from '@/server/api/endpoint-base.js'; +import { NotificationService } from '@/core/NotificationService.js'; + +export const meta = { + tags: ['notifications'], + + requireCredential: true, + + kind: 'write:notifications', +} as const; + +export const paramDef = { + type: 'object', + properties: {}, + required: [], +} as const; + +@Injectable() +export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-disable-line import/no-default-export + constructor( + private notificationService: NotificationService, + ) { + super(meta, paramDef, async (ps, user) => { + this.notificationService.createNotification(user.id, 'test', {}); + }); + } +} |