all repos — kōi @ 6552cde48bf0f293b876864af2aff29c013e24f5

Minimalist task manager

src/routes/(auth)/+page.server.ts (view raw)

 1import { getSolidDataset, getThingAll } from '@inrupt/solid-client';
 2import type { PageServerLoad } from './$types';
 3import { Task } from '$lib/models/task';
 4
 5export const load: PageServerLoad = async (event) => {
 6	const session = await event.locals.getSession();
 7	const iri = 'https://pod.5ika.ch/tasks/default';
 8	const dataset = await getSolidDataset(iri, {
 9		fetch: session.fetch
10	});
11	const taskThings = getThingAll(dataset);
12	const tasks = taskThings.map((thing) => new Task(thing)).map((task) => task.serialize());
13
14	console.log(tasks);
15
16	return { tasks };
17};