From 0822bee33b1bba6974d14358b5ed41e79e32f546 Mon Sep 17 00:00:00 2001 From: Stuart Long Chay Boon Date: Tue, 11 Oct 2022 13:15:22 +0800 Subject: [PATCH] [offers][fix] modify create profile endpoint to accept optional --- apps/portal/src/pages/offers/testCreateProfile.tsx | 14 +++++++------- .../src/server/router/offers-profile-router.ts | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/portal/src/pages/offers/testCreateProfile.tsx b/apps/portal/src/pages/offers/testCreateProfile.tsx index d1fe399a..8528cdac 100644 --- a/apps/portal/src/pages/offers/testCreateProfile.tsx +++ b/apps/portal/src/pages/offers/testCreateProfile.tsx @@ -38,7 +38,7 @@ function Test() { ], experiences: [ { - companyId: 'cl93m87pl0000tx1ofbafqz6f', + companyId: 'cl93patjt0003txewyiaky7xx', durationInMonths: 24, jobType: 'FULLTIME', level: 'Junior', @@ -65,8 +65,8 @@ function Test() { }, offers: [ { - comments: '', - companyId: 'cl93m87pl0000tx1ofbafqz6f', + // Comments: '', + companyId: 'cl93patjt0003txewyiaky7xx', job: { base: { currency: 'SGD', @@ -94,8 +94,8 @@ function Test() { negotiationStrategy: 'Leveraged having multiple offers', }, { - comments: '', - companyId: 'cl93m87pl0000tx1ofbafqz6f', + comments: undefined, + companyId: 'cl93patjt0003txewyiaky7xx', job: { base: { currency: 'SGD', @@ -120,13 +120,13 @@ function Test() { jobType: 'FULLTIME', location: 'Singapore, Singapore', monthYearReceived: new Date('2022-09-30T07:58:54.000Z'), - negotiationStrategy: 'Leveraged having multiple offers', + // NegotiationStrategy: 'Leveraged having multiple offers', }, ], }); }; - const profileId = 'cl92wiw30006vw3hg7dxa14fo'; // Remember to change this filed after testing deleting + const profileId = 'cl93qtuyc0000w3ideermqtcz'; // Remember to change this filed after testing deleting const data = trpc.useQuery([ `offers.profile.listOne`, { diff --git a/apps/portal/src/server/router/offers-profile-router.ts b/apps/portal/src/server/router/offers-profile-router.ts index 85a0bd01..aa4261e5 100644 --- a/apps/portal/src/server/router/offers-profile-router.ts +++ b/apps/portal/src/server/router/offers-profile-router.ts @@ -11,7 +11,7 @@ const valuation = z.object({ // TODO: handle both full time and intern const offer = z.object({ - comments: z.string(), + comments: z.string().optional(), companyId: z.string(), job: z.object({ base: valuation.optional(), // Full time @@ -28,7 +28,7 @@ const offer = z.object({ jobType: z.string(), location: z.string(), monthYearReceived: z.date(), - negotiationStrategy: z.string(), + negotiationStrategy: z.string().optional(), }); const experience = z.object({