From ef8c241b4880731516c735ba48286235cde0eb8c Mon Sep 17 00:00:00 2001 From: ReLoia Date: Sun, 14 Jun 2026 22:16:53 +0200 Subject: [PATCH] feat(auth): add update profile method to useAuth composable --- app/composables/useAuth.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/composables/useAuth.ts b/app/composables/useAuth.ts index 5ebbbdf..37e510d 100644 --- a/app/composables/useAuth.ts +++ b/app/composables/useAuth.ts @@ -4,7 +4,7 @@ import type { OkResponse, OtpRequestResponse, PasswordLoginRequest, RegisterCitizenRequest, RegisterCitizenResponse, RewardsResponse, - TokenResponse, VerifyOtpRequest + TokenResponse, VerifyOtpRequest, UpdateProfileRequest } from "~/types/api"; export const useAuth = () => { @@ -81,6 +81,9 @@ export const useAuth = () => { const changePassword = (body: ChangePasswordRequest) => useApiFetch('/api/v1/auth/change-password', { method: 'POST', body }) + const updateProfile = (body: UpdateProfileRequest) => + useApiFetch('/api/v1/me', { method: 'PATCH', body }) + const fetchCurrentUser = () => useApiFetch('/api/v1/me', { method: 'GET' }) @@ -108,6 +111,7 @@ export const useAuth = () => { verifyOtp, loginWithPassword, changePassword, + updateProfile, fetchCurrentUser, fetchRewards, fetchNotifications,