diff --git a/src/routes/report/[...url_hash]/+page.svelte b/src/routes/report/[...url_hash]/+page.svelte
index be71df6..1596927 100644
--- a/src/routes/report/[...url_hash]/+page.svelte
+++ b/src/routes/report/[...url_hash]/+page.svelte
@@ -5,6 +5,10 @@
let { data } = $props();
+ let reason = $state(data.reason);
+ let body = $state(data.body);
+ let reporterName = $state(data.reporter.name);
+ let reportedName = $state(data.reported.name || null);
let completed = $state(!data.draft);
@@ -18,9 +22,10 @@
{#if !completed}
(completed = true)}
/>
@@ -28,11 +33,11 @@
{:else}
diff --git a/src/routes/report/[...url_hash]/ReportDraft.svelte b/src/routes/report/[...url_hash]/ReportDraft.svelte
index 746b310..b8baa99 100644
--- a/src/routes/report/[...url_hash]/ReportDraft.svelte
+++ b/src/routes/report/[...url_hash]/ReportDraft.svelte
@@ -8,15 +8,17 @@
import { getPopupModalShowFn } from '$lib/context';
let {
- reporterName,
- reportedName = null,
- reason,
+ reporterName = $bindable(),
+ reportedName = $bindable(null),
+ reason = $bindable(),
+ body = $bindable(),
users,
onsubmit
}: {
reporterName: string;
reportedName: string | null;
reason: string;
+ body: string;
users: string[];
onsubmit: () => void;
} = $props();
@@ -24,7 +26,6 @@
let showPopupModal = getPopupModalShowFn();
let reported = $state(reportedName);
- let content = $state('');
async function submitReport() {
await fetch(`${env.PUBLIC_BASE_PATH}/report/${$page.params.url_hash}`, {
@@ -32,7 +33,7 @@
body: JSON.stringify({
reported: reported || null,
subject: reason,
- body: content
+ body: body
})
});
}
@@ -108,7 +109,7 @@
required={true}
rows={4}
label="Details über den Report Grund"
- bind:value={content}
+ bind:value={body}
/>
diff --git a/src/routes/report/[...url_hash]/ReportSubmitted.svelte b/src/routes/report/[...url_hash]/ReportSubmitted.svelte
index 400f5e5..5fa7d83 100644
--- a/src/routes/report/[...url_hash]/ReportSubmitted.svelte
+++ b/src/routes/report/[...url_hash]/ReportSubmitted.svelte
@@ -11,7 +11,7 @@
statement
}: {
reporterName: string;
- reportedName?: string;
+ reportedName: string | null;
status: 'none' | 'review' | 'reviewed';
reason: string;
body: string;