implemented /bookmark/<ID>/view

This commit is contained in:
2025-08-03 15:28:49 +02:00
parent b041e4e9be
commit 783eaf3303
8 changed files with 89 additions and 21 deletions

View File

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