diff --git a/frontend/src/lib/@api/candidate.ts b/frontend/src/lib/@api/candidate.ts index 251a64e..3515c41 100644 --- a/frontend/src/lib/@api/candidate.ts +++ b/frontend/src/lib/@api/candidate.ts @@ -26,7 +26,7 @@ export const apiFetchDetails = async (fetchSsr?: Fetch): Promise method: 'GET', credentials: 'include' }); - if (res.status != 200) { + if (!res.ok) { throw new Error(await res.text()); } return await res.json(); @@ -202,6 +202,17 @@ export const apiSubmitPortfolio = async (): Promise => { } }; +export const apiGetPortfolio = async (): Promise => { + const res = await fetch(API_URL + '/candidate/portfolio/download', { + method: 'GET', + credentials: 'include' + }); + if (!res.ok) { + throw errorHandler(await res.text(), 'Failed to download portfolio'); + } + return await res.blob(); +}; + export const apiDeltePortfolio = async (): Promise => { try { await axios.post(API_URL + '/candidate/portfolio/delete', {}, { withCredentials: true }); diff --git a/frontend/src/lib/components/checkbox/GdprCheckBox.svelte b/frontend/src/lib/components/checkbox/GdprCheckBox.svelte index 0ce3a4e..50ac4b3 100644 --- a/frontend/src/lib/components/checkbox/GdprCheckBox.svelte +++ b/frontend/src/lib/components/checkbox/GdprCheckBox.svelte @@ -8,12 +8,12 @@ class:error on:change type="checkbox" - id="gdpr-option" + id="gdpr" bind:checked={value} class="peer hidden" />