feat: set all candidate details

This commit is contained in:
Sebastian Pravda 2022-12-03 19:41:12 +01:00 committed by EETagent
parent 415a8728c9
commit 7cc7260c14

View file

@ -1,9 +1,10 @@
import { apiFetchDetails, apiFetchSubmissionProgress } from '$lib/@api/candidate';
import type { CandidateData } from '$lib/stores/candidate';
import { redirect } from '@sveltejs/kit';
import type { LayoutServerLoad } from './$types';
export const load: LayoutServerLoad = async ({ fetch }) => {
let details;
let details: CandidateData;
try {
details = await apiFetchDetails(fetch);
} catch (e: any) {
@ -22,11 +23,7 @@ export const load: LayoutServerLoad = async ({ fetch }) => {
}
return {
candidate: {
name: details.name,
surname: details.surname,
email: details.email
},
candidate: details,
submission: {
...submissionProgress
}