Shun Miyazawa 4 лет назад
Родитель
Сommit
e78eb89818

+ 10 - 0
packages/app/src/interfaces/in-app-notification-settings.ts

@@ -0,0 +1,10 @@
+import { Schema } from 'mongoose';
+
+export interface IDefaultSubscribeRule {
+  name: string,
+  isEnabled: boolean;
+}
+export interface IInAppNotificationSettings {
+  userId: Schema.Types.ObjectId;
+  defaultSubscribeRules: IDefaultSubscribeRule[];
+}

+ 7 - 9
packages/app/src/server/models/in-app-notification-settings.ts

@@ -1,21 +1,19 @@
 import { Schema, Model, Document } from 'mongoose';
 import { getOrCreateModel } from '../util/mongoose-utils';
 
-export interface IDefaultSubscribeRule {
-  name: string,
-  isEnabled: boolean;
-}
-export interface IInAppNotificationSettings {
-  userId: Schema.Types.ObjectId;
-  defaultSubscribeRules: IDefaultSubscribeRule[];
-}
+import { IInAppNotificationSettings } from '../../interfaces/in-app-notification-settings';
 
 export interface InAppNotificationSettingsDocument extends IInAppNotificationSettings, Document {}
 export type InAppNotificationSettingsModel = Model<InAppNotificationSettingsDocument>
 
 const inAppNotificationSettingsSchema = new Schema<IInAppNotificationSettings>({
   userId: { type: String },
-  defaultSubscribeRules: [{ name: { type: String }, isEnabled: { type: Boolean } }],
+  defaultSubscribeRules: [
+    {
+      name: { type: String },
+      isEnabled: { type: Boolean },
+    },
+  ],
 });
 
 // eslint-disable-next-line max-len