From f443f474ba0ef2e9b6abd0a813cc2d99ae9d8e84 Mon Sep 17 00:00:00 2001 From: Bastien Seree Date: Mon, 9 Dec 2024 12:03:31 +0100 Subject: [PATCH] EDF: [#75] add assigned_users field in table schema --- .../plugins/entreprisedufutur/schemas/TableSchema.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/backend/web/server/plugins/entreprisedufutur/schemas/TableSchema.js b/backend/web/server/plugins/entreprisedufutur/schemas/TableSchema.js index 52504a6835..8ac0a3122d 100644 --- a/backend/web/server/plugins/entreprisedufutur/schemas/TableSchema.js +++ b/backend/web/server/plugins/entreprisedufutur/schemas/TableSchema.js @@ -66,6 +66,15 @@ const TableSchema = new Schema({ validate: [function (value) {return value.length <= this.staff_number}, function () { return `Le nombre d'invité.e.s ne peut pas dépasser ${this.staff_number}`}], default: [] }, + assigned_users: { + type: [{ + type: Schema.Types.ObjectId, + ref: 'user', + required: true + }], + required: false, + default: [] + }, }, {...schemaOptions}) /* eslint-disable prefer-arrow-callback */