From 8b1b1354162c2ea01d5eea4eaa78fe4092abc184 Mon Sep 17 00:00:00 2001 From: Thijn Date: Tue, 10 Dec 2024 16:48:36 +0100 Subject: [PATCH 1/2] added more fields to medewerker --- src/entities/medewerkers/medewerkers.mock.ts | 1 + src/entities/medewerkers/medewerkers.ts | 4 +- src/entities/medewerkers/medewerkers.types.ts | 1 + src/modals/medewerkers/EditMedewerker.vue | 43 +++++-------------- 4 files changed, 15 insertions(+), 34 deletions(-) diff --git a/src/entities/medewerkers/medewerkers.mock.ts b/src/entities/medewerkers/medewerkers.mock.ts index 5fd76c5..6c45360 100644 --- a/src/entities/medewerkers/medewerkers.mock.ts +++ b/src/entities/medewerkers/medewerkers.mock.ts @@ -8,6 +8,7 @@ export const mockMedewerkerData = (): TMedewerker[] => [ tussenvoegsel: 'de', achternaam: 'Doe', email: 'john.doe@example.com', + telefoonnummer: '0612345678', }, ] diff --git a/src/entities/medewerkers/medewerkers.ts b/src/entities/medewerkers/medewerkers.ts index 0f5eb9f..302c6aa 100644 --- a/src/entities/medewerkers/medewerkers.ts +++ b/src/entities/medewerkers/medewerkers.ts @@ -8,6 +8,7 @@ export class Medewerker implements TMedewerker { public tussenvoegsel: string public achternaam: string public email: string + public telefoonnummer: string constructor(source: TMedewerker) { this.id = source.id || '' @@ -15,7 +16,7 @@ export class Medewerker implements TMedewerker { this.tussenvoegsel = source.tussenvoegsel || '' this.achternaam = source.achternaam || '' this.email = source.email || '' - + this.telefoonnummer = source.telefoonnummer || '' } public validate(): SafeParseReturnType { @@ -25,6 +26,7 @@ export class Medewerker implements TMedewerker { tussenvoegsel: z.string(), achternaam: z.string(), email: z.string().email(), + telefoonnummer: z.string().min(1), }) return schema.safeParse(this) diff --git a/src/entities/medewerkers/medewerkers.types.ts b/src/entities/medewerkers/medewerkers.types.ts index 7a50331..3face2b 100644 --- a/src/entities/medewerkers/medewerkers.types.ts +++ b/src/entities/medewerkers/medewerkers.types.ts @@ -4,4 +4,5 @@ export type TMedewerker = { tussenvoegsel: string; achternaam: string; email: string; + telefoonnummer: string; } diff --git a/src/modals/medewerkers/EditMedewerker.vue b/src/modals/medewerkers/EditMedewerker.vue index a9db1da..563f726 100644 --- a/src/modals/medewerkers/EditMedewerker.vue +++ b/src/modals/medewerkers/EditMedewerker.vue @@ -3,8 +3,7 @@ import { medewerkerStore, navigationStore } from '../../store/store.js'