From 9bee9d20f751d2cf5833c5b2cf8be875496250c2 Mon Sep 17 00:00:00 2001 From: tamaina Date: Tue, 26 May 2020 14:33:55 +0900 Subject: Improve typing --- src/models/entities/notification.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/models/entities/notification.ts') diff --git a/src/models/entities/notification.ts b/src/models/entities/notification.ts index 565645a5d6..988fdb341f 100644 --- a/src/models/entities/notification.ts +++ b/src/models/entities/notification.ts @@ -5,6 +5,7 @@ import { Note } from './note'; import { FollowRequest } from './follow-request'; import { UserGroupInvitation } from './user-group-invitation'; import { AccessToken } from './access-token'; +import { notificationTypes } from '../../types'; @Entity() export class Notification { @@ -66,10 +67,10 @@ export class Notification { */ @Index() @Column('enum', { - enum: ['follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app'], + enum: notificationTypes, comment: 'The type of the Notification.' }) - public type: 'follow' | 'mention' | 'reply' | 'renote' | 'quote' | 'reaction' | 'pollVote' | 'receiveFollowRequest' | 'followRequestAccepted' | 'groupInvited' | 'app'; + public type: typeof notificationTypes[number]; /** * 通知が読まれたかどうか -- cgit v1.3.1-freya