import type { PageLoad } from './$types';
import { error } from '@sveltejs/kit';
import { errorMsg, server } from '../../../helpers';
export const load: PageLoad = async ({ url, fetch, params }) => {
console.log(url);
const u = `${server}/api/discussion/${params.user}/${params.repo}${url.search}`;
console.log('querying', u);
const resp = await fetch(u, { credentials: 'include' });
if (resp.status == 200) {
return await resp.json();
} else {
throw error(resp.status);
}
};