Shun Miyazawa 3 лет назад
Родитель
Сommit
12e33eda0b

+ 3 - 3
packages/app/src/interfaces/activity.ts

@@ -70,9 +70,9 @@ export type ISnapshot = Partial<Pick<IUser, 'username'>>
 
 export type IActivity = {
   user?: IUser
-  targetModel: SupportedTargetModelType
-  target: string
-  action: SupportedActionType
+  targetModel?: SupportedTargetModelType
+  target?: string
+  action?: SupportedActionType
   createdAt: Date
   snapshot?: ISnapshot
 }

+ 0 - 4
packages/app/src/server/models/activity.ts

@@ -39,21 +39,17 @@ const activitySchema = new Schema<ActivityDocument, ActivityModel>({
     type: Schema.Types.ObjectId,
     ref: 'User',
     index: true,
-    required: true,
   },
   targetModel: {
     type: String,
-    required: true,
     enum: AllSupportedTargetModelType,
   },
   target: {
     type: Schema.Types.ObjectId,
     refPath: 'targetModel',
-    required: true,
   },
   action: {
     type: String,
-    required: true,
     enum: AllSupportedActionType,
   },
   snapshot: snapshotSchema,