From 0a7540ef1e0e95faa44c47c4c49f99a2c04ee2b3 Mon Sep 17 00:00:00 2001 From: rob Date: Sat, 1 Oct 2022 04:36:40 -0400 Subject: [PATCH] Add restrictions to resourceType enum --- app/models/content-report.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/content-report.js b/app/models/content-report.js index fa6adad..ffad674 100644 --- a/app/models/content-report.js +++ b/app/models/content-report.js @@ -13,7 +13,7 @@ const REPORT_CATEGORY_LIST = ['spam','violence','threat','porn','doxxing','other const ContentReportSchema = new Schema({ created: { type: Date, default: Date.now, required: true, index: 1, expires: '30d' }, user: { type: Schema.ObjectId, required: true, index: 1, ref: 'User' }, - resourceType: { type: String, enum: [ ], required: true }, + resourceType: { type: String, enum: ['Comment', 'ChatMessage'], required: true }, resource: { type: Schema.ObjectId, required: true, index: 1, refPath: 'resourceType' }, status: { type: String, enum: REPORT_STATUS_LIST, required: true, index: 1 }, category: { type: String, enum: REPORT_CATEGORY_LIST, required: true },