mirror of
https://github.com/danbulant/Portfolio
synced 2026-06-07 08:40:16 +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 pageIndex = 0;
|
||||||
let pagesFilled = 0;
|
let pagesFilled = 0;
|
||||||
|
|
||||||
const formInitialValues: CandidateData = {
|
const formInitialValues = {
|
||||||
name: '',
|
name: '',
|
||||||
surname: '',
|
surname: '',
|
||||||
email: '',
|
email: '',
|
||||||
|
|
|
||||||
|
|
@ -2,22 +2,21 @@ import { apiFetchDetails, apiFillDetails, apiLogin, apiLogout } from "../api/can
|
||||||
import { writable } from "svelte/store";
|
import { writable } from "svelte/store";
|
||||||
|
|
||||||
export interface CandidateData {
|
export interface CandidateData {
|
||||||
// id?: string;
|
name?: string;
|
||||||
name: string;
|
surname?: string;
|
||||||
surname: string;
|
birthplace?: string;
|
||||||
birthplace: string;
|
birthdate?: string;
|
||||||
birthdate: string;
|
address?: string;
|
||||||
address: string;
|
telephone?: string;
|
||||||
telephone: string;
|
citizenship?: string;
|
||||||
citizenship: string;
|
email?: string;
|
||||||
email: string;
|
sex?: string;
|
||||||
sex: string;
|
study?: string;
|
||||||
study: string;
|
personalIdNumber?: string;
|
||||||
personalIdNumber: string;
|
parentName?: string;
|
||||||
parentName: string;
|
parentSurname?: string;
|
||||||
parentSurname: string;
|
parentTelephone?: string;
|
||||||
parentTelephone: string;
|
parentEmail?: string;
|
||||||
parentEmail: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CandidateLogin {
|
export interface CandidateLogin {
|
||||||
|
|
@ -42,23 +41,7 @@ export async function logout() {
|
||||||
// TOOD: handle errors
|
// TOOD: handle errors
|
||||||
try {
|
try {
|
||||||
await apiLogout();
|
await apiLogout();
|
||||||
candidateData.set({
|
candidateData.set({});
|
||||||
name: "",
|
|
||||||
surname: "",
|
|
||||||
birthplace: "",
|
|
||||||
birthdate: "",
|
|
||||||
address: "",
|
|
||||||
telephone: "",
|
|
||||||
citizenship: "",
|
|
||||||
email: "",
|
|
||||||
sex: "",
|
|
||||||
study: "",
|
|
||||||
personalIdNumber: "",
|
|
||||||
parentName: "",
|
|
||||||
parentSurname: "",
|
|
||||||
parentTelephone: "",
|
|
||||||
parentEmail: ""
|
|
||||||
});
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue