From 1236b5a685ebcc5d413d6f591d1e09a588c97e89 Mon Sep 17 00:00:00 2001 From: SeghirOumo Date: Fri, 9 Aug 2024 15:07:04 +0200 Subject: [PATCH] Aftral[#90]: fixed declaration for resources in userschema --- .../server/plugins/aftral-lms/schemas/UserSchema.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/backend/web/server/plugins/aftral-lms/schemas/UserSchema.js b/backend/web/server/plugins/aftral-lms/schemas/UserSchema.js index f0749119df..b9b5d97204 100644 --- a/backend/web/server/plugins/aftral-lms/schemas/UserSchema.js +++ b/backend/web/server/plugins/aftral-lms/schemas/UserSchema.js @@ -42,11 +42,14 @@ const UserSchema = new Schema({ ref: 'program', required: false, }, - resources: [{ - type: Schema.Types.ObjectId, - ref: 'resource', - required: false - }], + resources: { + type: [{ + type: Schema.Types.ObjectId, + ref: 'resource', + }], + required: true, + default: [], + }, }, schemaOptions) /* eslint-disable prefer-arrow-callback */