From b08b86ca9d0c7aefa1249a33aa2a679630f297cf Mon Sep 17 00:00:00 2001 From: Calum McConnell Date: Thu, 11 Jan 2024 21:50:37 -0500 Subject: [PATCH] Update profile.ts to add default values Add some default values to the LinkedIn data import in case of missing data. Default values used in place of optional data in order to minimize changes to other parts of the codebase; since optionals require an extra step to handle. Default values of whitespace might work better, but I cannot test to be sure. Closes: #1604 --- libs/parser/src/linkedin/schema/profile.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libs/parser/src/linkedin/schema/profile.ts b/libs/parser/src/linkedin/schema/profile.ts index ba1f9f72..cdbeaa19 100644 --- a/libs/parser/src/linkedin/schema/profile.ts +++ b/libs/parser/src/linkedin/schema/profile.ts @@ -1,17 +1,17 @@ import { z } from "zod"; export const profileSchema = z.object({ - "First Name": z.string(), - "Last Name": z.string(), + "First Name": z.string().default("John"), + "Last Name": z.string().default("Doe"), "Maiden Name": z.string().optional(), - Address: z.string(), - "Birth Date": z.string(), - Headline: z.string(), - Summary: z.string(), - Industry: z.string(), + Address: z.string().default("111 Example Street"), + "Birth Date": z.string().default("January 1st, 1970"), + Headline: z.string().default("An Awesome Person"), + Summary: z.string().default("Look at this awesome person"), + Industry: z.string().default("Resume Building"), "Zip Code": z.string().optional(), - "Geo Location": z.string(), - "Twitter Handles": z.string(), - Websites: z.string(), + "Geo Location": z.string().default("Somewhere"), + "Twitter Handles": z.string().default("@test"), + Websites: z.string().default("example.com"), "Instant Messengers": z.string().optional(), });