Shun Miyazawa пре 4 година
родитељ
комит
8defd1b37f
1 измењених фајлова са 5 додато и 1 уклоњено
  1. 5 1
      packages/app/src/server/models/in-app-notification-settings.ts

+ 5 - 1
packages/app/src/server/models/in-app-notification-settings.ts

@@ -6,11 +6,15 @@ import { IInAppNotificationSettings } from '../../interfaces/in-app-notification
 export interface InAppNotificationSettingsDocument extends IInAppNotificationSettings, Document {}
 export type InAppNotificationSettingsModel = Model<InAppNotificationSettingsDocument>
 
+enum subscribeRules {
+  PAGE_CREATE = 'PAGE_CREATE'
+}
+
 const inAppNotificationSettingsSchema = new Schema<IInAppNotificationSettings>({
   userId: { type: String },
   defaultSubscribeRules: [
     {
-      name: { type: String },
+      name: { type: String, require: true, enum: subscribeRules },
       isEnabled: { type: Boolean },
     },
   ],