add feedback blank filter option

This commit is contained in:
2026-01-03 19:23:30 +01:00
parent dd063c568d
commit a197c002f4
7 changed files with 36 additions and 15 deletions

View File

@@ -1,7 +1,6 @@
<script lang="ts">
import BottomBar from './BottomBar.svelte';
import { feedbacks, fetchFeedbacks, type Feedback } from '@app/admin/feedback/feedback.ts';
import { onMount } from 'svelte';
import { feedbacks, type Feedback } from '@app/admin/feedback/feedback.ts';
import DataTable from '@components/admin/table/DataTable.svelte';
// consts
@@ -15,11 +14,6 @@
// states
let activeFeedback = $state<Feedback | null>(null);
// lifecycle
onMount(() => {
fetchFeedbacks();
});
</script>
{#snippet date(value: string)}

View File

@@ -0,0 +1,19 @@
<script lang="ts">
import Checkbox from '@components/input/Checkbox.svelte';
import { fetchFeedbacks } from './feedback';
// states
let showBlank = $state(false);
// lifecycle
$effect(() => {
fetchFeedbacks(showBlank);
});
</script>
<div>
<fieldset class="fieldset border border-base-content/50 rounded-box p-2">
<legend class="fieldset-legend">Filter</legend>
<Checkbox bind:checked={showBlank} label="Unausgefüllte zeigen" />
</fieldset>
</div>

View File

@@ -10,8 +10,8 @@ export type Feedback = Feedbacks[0];
export const feedbacks = writable<Feedbacks>([]);
// actions
export async function fetchFeedbacks(reporter?: string | null, reported?: string | null) {
const { data, error } = await actions.feedback.feedbacks({ reporter: reporter, reported: reported });
export async function fetchFeedbacks(includeBlanks: boolean) {
const { data, error } = await actions.feedback.feedbacks({ includeBlanks: includeBlanks });
if (error) {
actionErrorPopup(error);
return;