fix and refactor code
This commit is contained in:
@@ -10,7 +10,7 @@ export const useUserStore = defineStore('user', () => {
|
||||
|
||||
async function fetchProfile() {
|
||||
try {
|
||||
const res = await fetch('/api/admin/profile')
|
||||
const res = await fetch('/api/profile')
|
||||
if (res.ok) {
|
||||
const data = await res.json()
|
||||
id.value = data.id
|
||||
@@ -27,7 +27,7 @@ export const useUserStore = defineStore('user', () => {
|
||||
}
|
||||
|
||||
async function updateProfile(updates: { email?: string; password?: string; language?: string }) {
|
||||
const res = await fetch('/api/admin/profile', {
|
||||
const res = await fetch('/api/profile', {
|
||||
method: 'PUT',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(updates)
|
||||
|
||||
Reference in New Issue
Block a user