mirror of
https://github.com/danbulant/Portfolio
synced 2026-06-07 16:50:13 +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 { apiFetchDetails, apiFetchSubmissionProgress } from '$lib/@api/candidate';
|
||||||
|
import type { CandidateData } from '$lib/stores/candidate';
|
||||||
import { redirect } from '@sveltejs/kit';
|
import { redirect } from '@sveltejs/kit';
|
||||||
import type { LayoutServerLoad } from './$types';
|
import type { LayoutServerLoad } from './$types';
|
||||||
|
|
||||||
export const load: LayoutServerLoad = async ({ fetch }) => {
|
export const load: LayoutServerLoad = async ({ fetch }) => {
|
||||||
let details;
|
let details: CandidateData;
|
||||||
try {
|
try {
|
||||||
details = await apiFetchDetails(fetch);
|
details = await apiFetchDetails(fetch);
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
|
|
@ -22,11 +23,7 @@ export const load: LayoutServerLoad = async ({ fetch }) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
candidate: {
|
candidate: details,
|
||||||
name: details.name,
|
|
||||||
surname: details.surname,
|
|
||||||
email: details.email
|
|
||||||
},
|
|
||||||
submission: {
|
submission: {
|
||||||
...submissionProgress
|
...submissionProgress
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue