Skip to content

Commit

Permalink
add basepath to local fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian committed Apr 25, 2024
1 parent 7a9e106 commit 9abf443
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/routes/textzeugen/[sigla]/[thirties]/[verse]/+page.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import { base } from '$app/paths';
import { generateEntries } from '$lib/functions';
/** @type {import('./$types').PageLoad} */
export async function load({ fetch, params }) {
const sigla = params.sigla.split('-');
const meta = sigla.map((witnes) =>
fetch(`/api/json/metadata-ms-page/${witnes}/${params.thirties}/${params.verse}`).then((r) => {
if (r.status === 200) {
return r.json();
} else {
return { iiif: '', page: '' };
fetch(`${base}/api/json/metadata-ms-page/${witnes}/${params.thirties}/${params.verse}`).then(
(r) => {
if (r.status === 200) {
return r.json();
} else {
return { iiif: '', page: '' };
}
}
})
)
);
return {
sigla,
Expand Down

0 comments on commit 9abf443

Please sign in to comment.