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 <gsmithun4@gmail.com>
This commit is contained in:
Anantshree Chandola 2023-07-24 15:47:58 +05:30 committed by GitHub
parent 8f73f62d82
commit ebc5b79374
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 12 deletions

View file

@ -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}

View file

@ -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;
}

View file

@ -12,7 +12,6 @@ export class CreateUserDto {
@IsString()
@IsOptional()
@IsNotEmpty()
@Transform(({ value }) => sanitizeInput(value))
last_name: string;