all repos — kōi @ 13ba0aa72c94f508c54f3862f99e195a4ec73f4c

Minimalist task manager

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

 1import { getSolidDataset, getThingAll } from '@inrupt/solid-client';
 2import type { PageServerLoad } from './$types';
 3import { thingToTask } 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(thingToTask);
13	return { tasks, iri };
14};