From 0fab0b7f4842f93dcee6a3694204a474b38b6a6d Mon Sep 17 00:00:00 2001 From: Damillora Date: Sat, 22 Feb 2025 17:38:18 +0000 Subject: [PATCH] feat: add update user profile API --- web/app/src/lib/api.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/web/app/src/lib/api.ts b/web/app/src/lib/api.ts index 0a502ef..0c7a7d8 100644 --- a/web/app/src/lib/api.ts +++ b/web/app/src/lib/api.ts @@ -200,6 +200,21 @@ export async function updateTag(id, { name, tagTypeId }) { return response.data; } +export async function updateUserProfile({ email, username, oldPassword, newPassword }) { + const endpoint = url + "/api/tag/" + id; + const response = await axios({ + url: endpoint, + method: "PUT", + headers: { + 'Authorization': 'Bearer ' + current_token, + }, + withCredentials: true, + data: { + email, username, oldPassword, newPassword + } + }) + return response.data; +} export async function getTagTypes() { const endpoint = url + "/api/tagtype";