feat: add public user profiles
- Add GET /api/users/:username endpoint for public profiles - Create PublicProfilePage component with user stats and info - Add getUserByUsername function to API service - Add /:username route to App.jsx - Display user info: name, location, stats, WSDC ID, social links - Only show public data (no email or sensitive information) - Accessible only to authenticated users Users can now view public profiles of other users by visiting /<username>. The profile displays stats, location, WSDC ID, and social media links.
This commit is contained in:
@@ -160,6 +160,11 @@ export const authAPI = {
|
||||
return data;
|
||||
},
|
||||
|
||||
async getUserByUsername(username) {
|
||||
const data = await fetchAPI(`/users/${username}`);
|
||||
return data.data;
|
||||
},
|
||||
|
||||
logout() {
|
||||
localStorage.removeItem('token');
|
||||
localStorage.removeItem('user');
|
||||
|
||||
Reference in New Issue
Block a user