From ebc5b79374af67797235cd20a5ee6fdc88c19283 Mon Sep 17 00:00:00 2001 From: Anantshree Chandola Date: Mon, 24 Jul 2023 15:47:58 +0530 Subject: [PATCH] Remove validation for last name of users, Resolved: update user details bug (#6904) * remove validation for last name of users * lint issue --------- Co-authored-by: gsmithun4 --- frontend/src/Editor/Inspector/EventManager.jsx | 2 +- frontend/src/SettingsPage/SettingsPage.jsx | 14 ++++---------- server/src/dto/user.dto.ts | 1 - 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/frontend/src/Editor/Inspector/EventManager.jsx b/frontend/src/Editor/Inspector/EventManager.jsx index 1eb9bf8371..3cdf997c16 100644 --- a/frontend/src/Editor/Inspector/EventManager.jsx +++ b/frontend/src/Editor/Inspector/EventManager.jsx @@ -483,7 +483,7 @@ export const EventManager = ({ options={[ { name: 'CSV', value: 'csv' }, { name: 'Text', value: 'plaintext' }, - { name: 'PDF', value: 'pdf' } + { name: 'PDF', value: 'pdf' }, ]} value={event.fileType ?? 'csv'} search={true} diff --git a/frontend/src/SettingsPage/SettingsPage.jsx b/frontend/src/SettingsPage/SettingsPage.jsx index 3d3a7bded1..8abb85df78 100644 --- a/frontend/src/SettingsPage/SettingsPage.jsx +++ b/frontend/src/SettingsPage/SettingsPage.jsx @@ -28,16 +28,10 @@ function SettingsPage(props) { const updateDetails = async () => { const firstNameMatch = firstName.match(/^ *$/); - const lastNameMatch = lastName.match(/^ *$/); - if (firstNameMatch !== null || lastNameMatch !== null) { - toast.error( - `${firstNameMatch !== null ? 'First name' : ''}${ - lastNameMatch !== null ? (firstNameMatch !== null ? ' and last name' : 'Last name') : '' - } can't be empty!`, - { - position: 'top-center', - } - ); + if (firstNameMatch !== null) { + toast.error(`First name can't be empty!`, { + position: 'top-center', + }); return; } diff --git a/server/src/dto/user.dto.ts b/server/src/dto/user.dto.ts index c53bdaee57..80f82b2fb6 100644 --- a/server/src/dto/user.dto.ts +++ b/server/src/dto/user.dto.ts @@ -12,7 +12,6 @@ export class CreateUserDto { @IsString() @IsOptional() - @IsNotEmpty() @Transform(({ value }) => sanitizeInput(value)) last_name: string;