From d513b288840e5d6b35d875efc7cf7e21a070848b Mon Sep 17 00:00:00 2001 From: Bastien Seree Date: Mon, 16 Dec 2024 15:05:43 +0100 Subject: [PATCH] EDF: [#115] statut member is default value of field statut in company schema --- .../server/plugins/entreprisedufutur/schemas/CompanySchema.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/web/server/plugins/entreprisedufutur/schemas/CompanySchema.js b/backend/web/server/plugins/entreprisedufutur/schemas/CompanySchema.js index 5db97abfd..1bef64637 100644 --- a/backend/web/server/plugins/entreprisedufutur/schemas/CompanySchema.js +++ b/backend/web/server/plugins/entreprisedufutur/schemas/CompanySchema.js @@ -2,7 +2,7 @@ const mongoose = require('mongoose') const { schemaOptions } = require('../../../utils/schemas') const siret = require('siret') const { DUMMY_REF } = require('../../../utils/database') -const { SECTOR, COMPANY_SIZES, LOOKING_FOR_MISSION, STATUTS, STATUT_FOUNDER, STATUT_SPONSOR, COMPANY_TURNOVERS } = require('../consts') +const { SECTOR, COMPANY_SIZES, LOOKING_FOR_MISSION, STATUTS, STATUT_FOUNDER, STATUT_SPONSOR, COMPANY_TURNOVERS, STATUT_MEMBER } = require('../consts') const { isPhoneOk, isEmailOk } = require('../../../../utils/sms') const AddressSchema = require('../../../models/AddressSchema') @@ -142,7 +142,7 @@ const CompanySchema = new Schema( type: String, enum: Object.keys(STATUTS), required: false, - set: v => v || undefined, + default: STATUT_MEMBER }, sponsor: { type: [{