urls corrected on fetch

This commit is contained in:
2026-01-20 22:25:00 +00:00
parent c9189c4ef1
commit 2577dc46ee
4 changed files with 21 additions and 8 deletions

View File

@@ -7,10 +7,16 @@
middleware: ["login-required"]
})
const toast = useToast()
const { data: user_data, refresh: userRefresh } = useFetch("/me");
const conf = useRuntimeConfig()
const base_url = conf.app.baseURL.endsWith('/') ? conf.app.baseURL.slice(0, -1) : conf.app.baseURL
const { data: user_data, refresh: userRefresh } = useFetch(base_url + "/me");
const loading_btn = ref(false)
const schema = z.object({
first_name: z.string(),
last_name: z.string(),
@@ -21,7 +27,7 @@
async function submitChanges(event: FormSubmitEvent<Schema>) {
loading_btn.value = true
await fetch("/settings/edit_user", {
await fetch(base_url + "/settings/edit_user", {
method: "POST",
headers: {
"Content-Type": "application/json"