diff --git a/resources/js/Components/Graph/KnowledgeGraphViewer.vue b/resources/js/Components/Graph/KnowledgeGraphViewer.vue index 599b98e..a594e55 100644 --- a/resources/js/Components/Graph/KnowledgeGraphViewer.vue +++ b/resources/js/Components/Graph/KnowledgeGraphViewer.vue @@ -43,9 +43,9 @@ async function fetchGraph() { const url = props.contentId ? `/api/v1/graph/node/${props.contentId}` : `/api/v1/graph/space/${props.spaceId}`; - const xsrfToken = document.cookie.match(/XSRF-TOKEN=([^;]+)/)?.[1] ?? ''; + const xsrfToken = decodeURIComponent(document.cookie.match(/XSRF-TOKEN=([^;]+)/)?.[1] ?? ''); const res = await fetch(url, { - credentials: 'same-origin', + credentials: 'include', headers: { 'Accept': 'application/json', 'X-Requested-With': 'XMLHttpRequest', diff --git a/resources/js/Components/Media/MediaUploadZone.vue b/resources/js/Components/Media/MediaUploadZone.vue index 6509afb..28382af 100644 --- a/resources/js/Components/Media/MediaUploadZone.vue +++ b/resources/js/Components/Media/MediaUploadZone.vue @@ -76,8 +76,9 @@ async function uploadFile(file) { resolve({ ok: false }); }); - xhr.open('POST', '/api/media'); + xhr.open('POST', '/api/v1/media'); xhr.setRequestHeader('Accept', 'application/json'); + xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); xhr.setRequestHeader('X-XSRF-TOKEN', xsrfToken()); xhr.withCredentials = true; xhr.send(formData); diff --git a/resources/js/Layouts/MainLayout.vue b/resources/js/Layouts/MainLayout.vue index ae80b40..7b7c1d2 100644 --- a/resources/js/Layouts/MainLayout.vue +++ b/resources/js/Layouts/MainLayout.vue @@ -41,7 +41,6 @@ const navigation = [ { name: 'API Tokens', href: '/admin/tokens', icon: '🔑' }, { name: 'Webhooks', href: '/admin/webhooks', icon: '🔗' }, { name: 'Spaces', href: '/admin/spaces', icon: '🏢' }, - { name: 'Spaces', href: '/admin/spaces', icon: '🌐' }, { name: 'Settings', href: '/admin/settings', icon: '⚙️' }, { name: 'Languages', href: '/admin/settings/locales', icon: '🌐' }, { name: 'Plugins', href: '/admin/plugins', icon: '🧩' }, diff --git a/resources/js/Pages/Admin/Spaces/Create.vue b/resources/js/Pages/Admin/Spaces/Create.vue index a0a1d31..a79f7ca 100644 --- a/resources/js/Pages/Admin/Spaces/Create.vue +++ b/resources/js/Pages/Admin/Spaces/Create.vue @@ -34,85 +34,85 @@ watch(() => form.name, (value) => { function submit() { form.post('/admin/spaces') } + +defineOptions({ layout: MainLayout })