add feedback blank filter option
This commit is contained in:
@@ -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)}
|
||||
|
||||
19
src/app/admin/feedback/SidebarActions.svelte
Normal file
19
src/app/admin/feedback/SidebarActions.svelte
Normal 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>
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user