a lil frontend work (as a treat)
This commit is contained in:
parent
9fe6529c1b
commit
77a93fd148
|
@ -20,6 +20,7 @@ func Mount(srv *server.Server, r chi.Router) {
|
||||||
r.Get("/reports/by-user/{id}", server.WrapHandler(s.getReportsByUser))
|
r.Get("/reports/by-user/{id}", server.WrapHandler(s.getReportsByUser))
|
||||||
r.Get("/reports/by-reporter/{id}", server.WrapHandler(s.getReportsByReporter))
|
r.Get("/reports/by-reporter/{id}", server.WrapHandler(s.getReportsByReporter))
|
||||||
|
|
||||||
|
r.Get("/reports/{id}", nil)
|
||||||
r.Patch("/reports/{id}", nil)
|
r.Patch("/reports/{id}", nil)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -81,6 +81,19 @@ export interface Invite {
|
||||||
used: boolean;
|
used: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface Report {
|
||||||
|
id: string;
|
||||||
|
user_id: string;
|
||||||
|
member_id: string | null;
|
||||||
|
reason: string;
|
||||||
|
reporter_id: string;
|
||||||
|
|
||||||
|
created_at: string;
|
||||||
|
resolved_at: string | null;
|
||||||
|
admin_id: string | null;
|
||||||
|
admin_comment: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
export interface APIError {
|
export interface APIError {
|
||||||
code: ErrorCode;
|
code: ErrorCode;
|
||||||
message?: string;
|
message?: string;
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
<slot />
|
|
@ -0,0 +1 @@
|
||||||
|
export const ssr = false;
|
|
@ -0,0 +1,5 @@
|
||||||
|
<script lang="ts">
|
||||||
|
import type { PageData } from "./$types";
|
||||||
|
|
||||||
|
export let data: PageData;
|
||||||
|
</script>
|
|
@ -0,0 +1,15 @@
|
||||||
|
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[];
|
||||||
|
}
|
Loading…
Reference in New Issue