pronounscc/frontend/src/routes/reports/+page.ts

16 lines
440 B
TypeScript
Raw Normal View History

2023-03-23 09:30:23 +01:00
import type { Report } from "$lib/api/entities";
import { apiFetchClient } from "$lib/api/fetch";
export const load = async () => {
const reports = await apiFetchClient<Report[]>("/admin/reports");
return { page: 0, isClosed: false, userId: null, reporterId: null, reports } as PageLoadData;
};
interface PageLoadData {
page: number;
isClosed: boolean;
userId: string | null;
reporterId: string | null;
reports: Report[];
}