Issue 102 | Full user profile management (no pfp)#238
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements to user profile, preferences, and password management, with a focus on input validation, controller simplification, and API consistency. The backend now uses Zod schemas for request validation, reducing manual checks and improving maintainability. New endpoints for changing passwords and fetching/updating user profiles and preferences have been added, and the frontend is updated to use these endpoints. Below are the most important changes grouped by theme:
Backend: User Controllers and Validation
userValidators.tsfor profile updates, preferences, and password changes, replacing manual validation logic in controllers.updateProfileandupdatePreferencescontrollers to use their respective schemas, simplifying the update logic and ensuring consistent input handling. [1] [2] [3]changePassword(for authenticated users to change their password) andgetProfile(to fetch the current user's profile). [1] [2]Backend: Routing and API Structure
userRoutes.tsto add new endpoints for profile, preferences, and password actions, and reorganized route order for clarity and usability. [1] [2] [3]user/index.tsbarrel file.Frontend: API Integration
authApi.tsto use/users/profilefor fetching the current user, and added helpers for updating profile, changing password, and managing preferences. [1] [2] [3]AuthProvider.tsxto clarify endpoint usage for fetching user data.Miscellaneous
DashboardHeader.tsxfor better UI consistency. [1] [2]tsconfig.jsonto exclude test files from compilation.user.tsregarding future profile image upload support.Closes #102