This commit is contained in:
HAM!DREZA
2024-05-31 00:03:10 +03:30
parent fd5b06c2d7
commit 2242ed022f
17 changed files with 379 additions and 96 deletions
+27
View File
@@ -0,0 +1,27 @@
export default defineEventHandler(async (event) => {
const body = await readBody(event);
const { public: { apiBase } } = useRuntimeConfig();
const token = getCookie(event, 'token');
console.log(body);
try {
const data = await $fetch(`${apiBase}/user/update`, {
method: 'PUT',
body: {
avatarMediaId: "",
name: body.name,
lastName: "",
userName: "",
email: body.email,
userName: body.userName
},
headers: {
'Accept': 'application/json',
'Authorization': `Bearer ${token}`
}
});
return data;
} catch (err) {
return err
}
})