impler.io icon indicating copy to clipboard operation
impler.io copied to clipboard

FirstName & LastName first chracter should be capitalized

Open chavda-bhavik opened this issue 1 year ago • 8 comments

Is your feature request related to a problem? Please describe. If the user signs up, his/her first and last name should have the first letter in uppercase and other letters should be in lowercase.

Describe the solution you'd like We can do an update in the signup form to send the formatted name in the backend.

chavda-bhavik avatar Sep 02 '24 10:09 chavda-bhavik

I think this can solve the problem with the name and surname:

/**
   * Name formater to capitalize the first letter
   * @param name string to capitalize
   * @returns a string with the name with capital letter at char position 0
   */
  const formatName = (name: string): string => {
    if (!name) return '';
    return name.charAt(0).toUpperCase() + name.slice(1).toLowerCase();
  };
  

  /** 
   * Now we can send the info in the right format to the back end
  */
  const onSignup = (data: ISignupFormData) => {
    const nameParts = data.fullName.trim().split(' ');// We save the name parts as an array with the fristName and the lastName
  
    
    const firstName = formatName(nameParts[0]);
    const lastName = nameParts.length > 1 ? formatName(nameParts.slice(1).join(' ')) : '';
  
    const signupData: ISignupData = {
      firstName: firstName, 
      lastName: lastName,   
      email: data.email,
      password: data.password,
    };
  
    signup(signupData);
  }; 

JotaceCode avatar Sep 04 '24 11:09 JotaceCode

@JotaceCode Looking awesome. Would you like to create a merge request for it? Thanks for taking a look.

chavda-bhavik avatar Sep 17 '24 12:09 chavda-bhavik

@JotaceCode I can assign this issue to you if you like.

chavda-bhavik avatar Sep 17 '24 12:09 chavda-bhavik

Ok let me do the pr!

JotaceCode avatar Sep 18 '24 11:09 JotaceCode

.take

BatatiDE avatar Nov 19 '24 20:11 BatatiDE

Can i Work on this?

0xEbrahim avatar May 14 '25 18:05 0xEbrahim

Hey @0xEbrahim open for it?

chavda-bhavik avatar May 15 '25 02:05 chavda-bhavik

Hey @0xEbrahim open for it?

Yeah, assign it to me too

0xEbrahim avatar May 15 '25 05:05 0xEbrahim

Hello everyone, this requirement has already been addressed in the current release, so I am closing this issue.

thisismayuresh avatar Aug 28 '25 10:08 thisismayuresh