Skip to content

Comments

feat: edit profile (modal + context)#11

Open
shreyannandanwar wants to merge 3 commits intoCPSquad1:mainfrom
shreyannandanwar:main
Open

feat: edit profile (modal + context)#11
shreyannandanwar wants to merge 3 commits intoCPSquad1:mainfrom
shreyannandanwar:main

Conversation

@shreyannandanwar
Copy link

🔧 Feature: Edit Profile (front & back)

Closes #6


✅ What was delivered

Requirement Status
"Edit Profile" button on /dashboard
Modal form EditProfileForm.jsx
Prefills current user data
Calls PUT /api/auth/profile
Updates global AuthContext instantly
Success / error alerts
Protected route (only authenticated)

🗂 Files changed

Path Purpose
src/context/AuthContext.jsx New context + refreshUser()
src/services/api.js Re-usable updateProfile() caller
src/components/Common/ProtectedRoute.jsx Route guard
src/components/Auth/EditProfileForm.jsx Full modal form (context + service)
src/pages/Dashboard.jsx Added "Edit Profile" trigger button
src/main.jsx Wrapped app with AuthProvider
src/App.jsx Dashboard now inside ProtectedRoute
backend/src/controllers/authController.js updateProfile controller
backend/src/routes/authRoutes.js New PUT /api/auth/profile (protected)

🧪 How to test locally

  1. git checkout feature/edit-profile
  2. Backend:
    cd backend
    npm i
    npm run dev

@CPSquad1
Copy link
Owner

@shreyannandanwar Can you just provide the ss of the thing you just built, also one more thing - just check the dist folder, I think it should be in .gitignore .

@shreyannandanwar
Copy link
Author

I can show once the sign up and login page is built
if u approve it i would also like to do that

@shreyannandanwar
Copy link
Author

#12 #13

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.

Edit User Profile (Update User Details)

2 participants