refactor: use GET/Query for report fetch

Signed-off-by: izzy <me@insrt.uk>
This commit is contained in:
izzy
2026-02-12 10:54:19 +00:00
parent 5ed0ff41e3
commit fbdeb0409e
12 changed files with 103 additions and 227 deletions

View File

@@ -17,14 +17,13 @@
let { data }: Props = $props();
// svelte-ignore state_referenced_locally
let integrityReport = $state(data.integrityReport);
async function loadMore() {
const { items, nextCursor } = await getIntegrityReport({
integrityGetReportDto: {
type: data.type,
cursor: integrityReport.nextCursor,
},
$type: data.type,
cursor: integrityReport.nextCursor,
});
integrityReport.items.push(...items);
@@ -41,9 +40,7 @@
expectingUpdate = true;
} else if (expectingUpdate) {
integrityReport = await getIntegrityReport({
integrityGetReportDto: {
type: data.type,
},
$type: data.type,
});
expectingUpdate = false;
}

View File

@@ -8,9 +8,7 @@ export const load = (async ({ params, url }) => {
await authenticate(url, { admin: true });
const integrityReport = await getIntegrityReport({
integrityGetReportDto: {
type,
},
$type: type,
});
const $t = await getFormatter();