mirror of
https://github.com/danbulant/Portfolio
synced 2026-05-24 12:35:31 +00:00
feat: nullable CandidateData fields
This commit is contained in:
parent
b48d20c689
commit
c4e5a88192
2 changed files with 17 additions and 34 deletions
|
|
@ -22,7 +22,7 @@
|
|||
let pageIndex = 0;
|
||||
let pagesFilled = 0;
|
||||
|
||||
const formInitialValues: CandidateData = {
|
||||
const formInitialValues = {
|
||||
name: '',
|
||||
surname: '',
|
||||
email: '',
|
||||
|
|
|
|||
|
|
@ -2,22 +2,21 @@ import { apiFetchDetails, apiFillDetails, apiLogin, apiLogout } from "../api/can
|
|||
import { writable } from "svelte/store";
|
||||
|
||||
export interface CandidateData {
|
||||
// id?: string;
|
||||
name: string;
|
||||
surname: string;
|
||||
birthplace: string;
|
||||
birthdate: string;
|
||||
address: string;
|
||||
telephone: string;
|
||||
citizenship: string;
|
||||
email: string;
|
||||
sex: string;
|
||||
study: string;
|
||||
personalIdNumber: string;
|
||||
parentName: string;
|
||||
parentSurname: string;
|
||||
parentTelephone: string;
|
||||
parentEmail: string;
|
||||
name?: string;
|
||||
surname?: string;
|
||||
birthplace?: string;
|
||||
birthdate?: string;
|
||||
address?: string;
|
||||
telephone?: string;
|
||||
citizenship?: string;
|
||||
email?: string;
|
||||
sex?: string;
|
||||
study?: string;
|
||||
personalIdNumber?: string;
|
||||
parentName?: string;
|
||||
parentSurname?: string;
|
||||
parentTelephone?: string;
|
||||
parentEmail?: string;
|
||||
}
|
||||
|
||||
export interface CandidateLogin {
|
||||
|
|
@ -42,23 +41,7 @@ export async function logout() {
|
|||
// TOOD: handle errors
|
||||
try {
|
||||
await apiLogout();
|
||||
candidateData.set({
|
||||
name: "",
|
||||
surname: "",
|
||||
birthplace: "",
|
||||
birthdate: "",
|
||||
address: "",
|
||||
telephone: "",
|
||||
citizenship: "",
|
||||
email: "",
|
||||
sex: "",
|
||||
study: "",
|
||||
personalIdNumber: "",
|
||||
parentName: "",
|
||||
parentSurname: "",
|
||||
parentTelephone: "",
|
||||
parentEmail: ""
|
||||
});
|
||||
candidateData.set({});
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue