diff --git a/src/stores/user/index.ts b/src/stores/user/index.ts index fc03bc55..06c66e6d 100644 --- a/src/stores/user/index.ts +++ b/src/stores/user/index.ts @@ -115,13 +115,25 @@ const useUserStore = defineStore('api-user', () => { transactionId: string; }, ) { - const res = await api.put(`/user/${id}`, data, { - headers: { - 'X-Session-Id': flow?.sessionId, - 'X-Rtid': flow?.refTransactionId, - 'X-Tid': flow?.transactionId, + const res = await api.put( + `/user/${id}`, + data, + { + headers: { + 'X-Session-Id': flow?.sessionId, + 'X-Rtid': flow?.refTransactionId, + 'X-Tid': flow?.transactionId, + }, }, - }); + ); + + if (data.profileImage) + await axios + .put(res.data.profileImageUploadUrl, data.profileImage, { + headers: { 'Content-Type': data.profileImage.type }, + onUploadProgress: (e) => console.log(e), + }) + .catch((e) => console.error(e)); if (!res) return false;