feat: return to register if details not set

This commit is contained in:
EETagent 2022-12-03 16:41:56 +01:00
parent b7225ad550
commit a95e89e8f1

View file

@ -0,0 +1,11 @@
import { apiFetchDetails } from '$lib/@api/candidate';
import { redirect } from '@sveltejs/kit';
import type { LayoutServerLoad } from './$types';
export const load: LayoutServerLoad = async ({ fetch }) => {
const details = await apiFetchDetails(fetch);
if (details === null) {
throw redirect(302, '/register');
}
};