make reported user nullable
All checks were successful
delpoy / build-and-deploy (push) Successful in 44s
All checks were successful
delpoy / build-and-deploy (push) Successful in 44s
This commit is contained in:
@@ -22,7 +22,7 @@ export const load: PageServerLoad = async ({ params }) => {
|
||||
name: report.reporter.username
|
||||
},
|
||||
reported: {
|
||||
name: report.reported.username
|
||||
name: report.reported?.username || null
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
<div class="col-[1] row-[1]" transition:fly={{ x: -200, duration: 300 }}>
|
||||
<ReportDraft
|
||||
reason={data.reason}
|
||||
reporterName={data.reporter.name}
|
||||
reportedName={data.reported.name}
|
||||
on:submit={() => (data.draft = false)}
|
||||
/>
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
import { page } from '$app/stores';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
|
||||
export let reportedName: string;
|
||||
export let reporterName: string;
|
||||
export let reportedName: string | null;
|
||||
export let reason: string;
|
||||
|
||||
let body: string;
|
||||
@@ -25,7 +26,10 @@
|
||||
</script>
|
||||
|
||||
<div>
|
||||
<h2 class="text-3xl text-center">Report für <code>{reportedName}</code></h2>
|
||||
<h2 class="text-3xl text-center">
|
||||
Report von <span class="underline">{reporterName}</span> gegen
|
||||
<span class="underline">{reportedName || 'unbekannt'}</span>
|
||||
</h2>
|
||||
<form on:submit|preventDefault={() => submitModal.show()}>
|
||||
<div class="space-y-4 my-4">
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user