mirror of
https://github.com/danbulant/Portfolio
synced 2026-05-27 14:02:14 +00:00
feat: return to register if details not set
This commit is contained in:
parent
b7225ad550
commit
a95e89e8f1
1 changed files with 11 additions and 0 deletions
|
|
@ -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');
|
||||||
|
}
|
||||||
|
};
|
||||||
Loading…
Reference in a new issue