summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api/endpoints
diff options
context:
space:
mode:
authorかっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>2023-09-11 14:31:50 +0900
committerGitHub <noreply@github.com>2023-09-11 14:31:50 +0900
commitcd6428715e6780d51e8f6edf93fe7e32bd8f937b (patch)
tree3a1ac5a3f7d01f4fa1fbcb29af7c5bd9df0d6581 /packages/backend/src/server/api/endpoints
parentfix (diff)
downloadsharkey-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')
-rw-r--r--packages/backend/src/server/api/endpoints/notifications/test-notification.ts33
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', {});
+ });
+ }
+}