From 71b77d82aff235d145d4af4149a83674f61f8884 Mon Sep 17 00:00:00 2001 From: "luisa.bellitto" Date: Sun, 29 Jun 2025 16:01:08 +0200 Subject: [PATCH] fix bio on save --- code/backend/src/routes/profileRoutes.ts | 2 +- code/frontend/src/components/Bio.tsx | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/code/backend/src/routes/profileRoutes.ts b/code/backend/src/routes/profileRoutes.ts index f1915a7..41691dd 100644 --- a/code/backend/src/routes/profileRoutes.ts +++ b/code/backend/src/routes/profileRoutes.ts @@ -72,7 +72,7 @@ profileRouter.get("/getProfilePicture/:username", getProfilePicture); /** * @swagger * /api/profile/updateBio: - * post: + * put: * summary: Update user bio * description: Updates the bio (short description) of the currently authenticated user. * tags: diff --git a/code/frontend/src/components/Bio.tsx b/code/frontend/src/components/Bio.tsx index 9324ea8..af2bc1b 100644 --- a/code/frontend/src/components/Bio.tsx +++ b/code/frontend/src/components/Bio.tsx @@ -25,10 +25,9 @@ export default function BioTextField({ ownAccount, bioText, setBio } : { ownAcco const saveBio = async () => { try { - const response = await api.post("http://localhost:3001/api/profile/updateBio", { + await api.put("/profile/updateBio", { bio: bioText, }); - setBio(response.data.data.bio); setEditable(false); } catch (error) { console.error("Error saving bio: ", error);