working on wiki index page and page display

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-09-09 20:01:21 +02:00
parent 3627ccee73
commit 4c441b1e46
3 changed files with 42 additions and 5 deletions

View File

@@ -0,0 +1,28 @@
<script>
import { onMount } from 'svelte';
import { api } from '../../urls.svelte';
import { t } from '../../translations.svelte';
import Editor from '../../Components/MarkdownEditor.svelte';
let error = $state(null);
let { id } = $props();
let page = $state(null);
async function loadPage(){
const url = api(`wiki/page/${id}`);
const res = await fetch(url,{credentials:'include'});
if (res.ok){
page = await res.json();
error = null;
} else {
error = await res.text();
}
}
onMount(loadPage);
</script>
<h2>{id}</h2>
{#if error}
<span class="error">{error}</span>
{/if}