diff options
Diffstat (limited to 'packages/backend/src/server/api/endpoints/sw/register.ts')
| -rw-r--r-- | packages/backend/src/server/api/endpoints/sw/register.ts | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/packages/backend/src/server/api/endpoints/sw/register.ts b/packages/backend/src/server/api/endpoints/sw/register.ts index 9734746770..ae3e9ce77a 100644 --- a/packages/backend/src/server/api/endpoints/sw/register.ts +++ b/packages/backend/src/server/api/endpoints/sw/register.ts @@ -7,7 +7,7 @@ import { SwSubscriptions } from '@/models/index'; export const meta = { tags: ['account'], - requireCredential: true as const, + requireCredential: true, params: { endpoint: { @@ -24,22 +24,23 @@ export const meta = { }, res: { - type: 'object' as const, - optional: false as const, nullable: false as const, + type: 'object', + optional: false, nullable: false, properties: { state: { - type: 'string' as const, - optional: false as const, nullable: false as const, + type: 'string', + optional: false, nullable: false, enum: ['already-subscribed', 'subscribed'], }, key: { - type: 'string' as const, - optional: false as const, nullable: false as const, + type: 'string', + optional: false, nullable: false, }, }, }, -}; +} as const; +// eslint-disable-next-line import/no-default-export export default define(meta, async (ps, user) => { // if already subscribed const exist = await SwSubscriptions.findOne({ |