Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ✨ Type: Enhancement, 'Refactoring | Title: Addition of Username Change Functionality and Minor Refactoring #26

Merged
merged 1 commit into from
Dec 27, 2023

Conversation

RicardoGEsteves
Copy link
Owner

Description:
The changes mainly involve the addition of a new feature that allows users to change their username. This includes the creation of a new form for username change, validation for the username, and the API route for the username update. Additionally, minor refactoring has been done in the existing code.

Main Files Walkthrough:

  • app/(main)/settings/_components/user-name-form.tsx: This new file contains the form for changing the username. It includes form validation and error handling.
  • app/api/username/route.ts: This new file defines the API route for updating the username. It includes error handling for cases where the username is already taken or if there is an error in the request.
  • lib/validators/username.ts: This new file contains the validation schema for the username. It ensures that the username is a string of length between 3 and 32 and only contains alphanumeric characters and underscores.
  • app/(main)/settings/page.tsx: This new file is the settings page where the username change form is displayed.
  • components/ui/card.tsx: This new file contains the Card component used in the settings page.
  • components/navigation/search-bar.tsx: Minor refactoring has been done in this file. The changes do not affect the functionality of the code.
  • app/(main)/(home)/page.tsx: Minor refactoring has been done in this file. The changes do not affect the functionality of the code.

Users can now customize and change their usernames.

… Change Functionality and Minor Refactoring

Description:
The changes mainly involve the addition of a new feature that allows users to change their username. This includes the creation of a new form for username change, validation for the username, and the API route for the username update. Additionally, minor refactoring has been done in the existing code.

Main Files Walkthrough:
- app/(main)/settings/_components/user-name-form.tsx: This new file contains the form for changing the username. It includes form validation and error handling.
- app/api/username/route.ts: This new file defines the API route for updating the username. It includes error handling for cases where the username is already taken or if there is an error in the request.
- lib/validators/username.ts: This new file contains the validation schema for the username. It ensures that the username is a string of length between 3 and 32 and only contains alphanumeric characters and underscores.
- app/(main)/settings/page.tsx: This new file is the settings page where the username change form is displayed.
- components/ui/card.tsx: This new file contains the Card component used in the settings page.
- components/navigation/search-bar.tsx: Minor refactoring has been done in this file. The changes do not affect the functionality of the code.
- app/(main)/(home)/page.tsx: Minor refactoring has been done in this file. The changes do not affect the functionality of the code.

Users can now customize and change their usernames.
@RicardoGEsteves RicardoGEsteves merged commit 9e9d1b3 into main Dec 27, 2023
3 checks passed
@RicardoGEsteves RicardoGEsteves deleted the settings branch December 27, 2023 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant