import { error } from '@sveltejs/kit';

/** @type {import('./$types').PageLoad} */
export async function load({ params, fetch }) {
	const request = await fetch(`http://localhost:5165/api/note/${params.id}`)

	const note = await request.json();

	if(request.status != 200){
		error(request.status, note.title);
	}

	return {
		note
	}
}