mirror of
https://github.com/danbulant/Portfolio
synced 2026-05-24 12:35:31 +00:00
feat: set all candidate details
This commit is contained in:
parent
415a8728c9
commit
7cc7260c14
1 changed files with 3 additions and 6 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue