fix(docs): frontend load must fetch /api/docs (not /docs) for SSR proxy

- hooks.server.ts only proxies /api/* to Flask (strips /api prefix)
- load() fetching /docs (no /api) caused SSR recursion/500
- Revert to /api/docs so proxy reaches Flask /docs route correctly
- selectDoc client fetch already uses /api/docs (correct)
This commit is contained in:
a2nr 2026-08-17 13:05:59 +07:00
parent d243df898a
commit 429b23e9b8
2 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@ import type { DocsIndexEntry } from '$types/docs';
import { error } from '@sveltejs/kit';
export const load: PageLoad = async ({ fetch }) => {
const res = await fetch('/docs');
const res = await fetch('/api/docs');
if (!res.ok) {
throw error(500, 'Gagal memuat daftar dokumentasi');
}

View File

@ -3,7 +3,7 @@ import type { DocContent } from '$types/docs';
import { error } from '@sveltejs/kit';
export const load: PageLoad = async ({ params, fetch }) => {
const res = await fetch(`/docs/${params.slug}`);
const res = await fetch(`/api/docs/${params.slug}`);
if (!res.ok) {
throw error(404, 'Dokumen tidak ditemukan');
}