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

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

	const note = await request.json();

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

	return {
		note
	}
}