Files
classquiz-ai/frontend/src/routes/results/+page.ts
T
2023-06-30 13:16:12 +02:00

19 lines
382 B
TypeScript

// SPDX-FileCopyrightText: 2023 Marlon W (Mawoka)
//
// SPDX-License-Identifier: MPL-2.0
// import type { PageLoad } from './$types';
export const load = async ({ fetch }) => {
const res = await fetch('/api/v1/results/list?include_quiz=true');
let json;
if (res.ok) {
json = await res.json();
} else {
json = [];
}
return {
results: json
};
}; // satisfies PageLoad;