From a5fb25e41ec179f8d879267ae6e8304b6ce20706 Mon Sep 17 00:00:00 2001 From: melohagan <101575380+melohagan@users.noreply.github.com> Date: Wed, 9 Aug 2023 10:38:04 +0100 Subject: [PATCH 1/2] Allow null for firstName and lastName (#11482) --- packages/worker/src/api/routes/validation/users.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/worker/src/api/routes/validation/users.ts b/packages/worker/src/api/routes/validation/users.ts index 30a3d67434..dfc1e6fbbf 100644 --- a/packages/worker/src/api/routes/validation/users.ts +++ b/packages/worker/src/api/routes/validation/users.ts @@ -1,12 +1,14 @@ import { auth } from "@budibase/backend-core" import Joi from "joi" +const OPTIONAL_STRING = Joi.string().allow(null, "") + let schema: any = { - email: Joi.string().allow(null, ""), - password: Joi.string().allow(null, ""), + email: OPTIONAL_STRING, + password: OPTIONAL_STRING, forceResetPassword: Joi.boolean().optional(), - firstName: Joi.string().allow(null, ""), - lastName: Joi.string().allow(null, ""), + firstName: OPTIONAL_STRING, + lastName: OPTIONAL_STRING, builder: Joi.object({ global: Joi.boolean().optional(), apps: Joi.array().optional(), @@ -21,8 +23,8 @@ export const buildSelfSaveValidation = () => { schema = { password: Joi.string().optional(), forceResetPassword: Joi.boolean().optional(), - firstName: Joi.string().allow("").optional(), - lastName: Joi.string().allow("").optional(), + firstName: OPTIONAL_STRING, + lastName: OPTIONAL_STRING, onboardedAt: Joi.string().optional(), } return auth.joiValidator.body(Joi.object(schema).required().unknown(false)) From 0fc1f13daad722505d5eea904d90acad66e8822a Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 9 Aug 2023 09:38:26 +0000 Subject: [PATCH 2/2] Bump version to 2.9.15 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 93db547474..9a9c4ec560 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.14", + "version": "2.9.15", "npmClient": "yarn", "packages": [ "packages/*"