Skip to content

Commit 68abe0f

Browse files
refactor: make nullable fields nullish instead of optional (#3307)
1 parent eb545b1 commit 68abe0f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/common/schema/profile.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const userExperiencesSchema = z
1212
export const userExperienceInputBaseSchema = z.object({
1313
type: z.enum(UserExperienceType),
1414
title: z.string().max(1000).nonempty(),
15-
description: z.string().max(5000).optional(),
15+
description: z.string().max(5000).nullish(),
1616
subtitle: z.string().max(1000).optional().nullable(),
1717
startedAt: z.date(),
1818
endedAt: z.date().optional().nullable().default(null),
@@ -28,17 +28,17 @@ export const userExperienceInputBaseSchema = z.object({
2828

2929
export const userExperienceCertificationSchema = z
3030
.object({
31-
url: z.url().optional(),
32-
externalReferenceId: z.string().optional(),
31+
url: z.url().nullish(),
32+
externalReferenceId: z.string().nullish(),
3333
})
3434
.extend(userExperienceInputBaseSchema.shape);
3535

3636
export const userExperienceEducationSchema = z
37-
.object({ grade: z.string().optional() })
37+
.object({ grade: z.string().nullish() })
3838
.extend(userExperienceInputBaseSchema.shape);
3939

4040
export const userExperienceProjectSchema = z
41-
.object({ url: z.url().optional() })
41+
.object({ url: z.url().nullish() })
4242
.extend(userExperienceInputBaseSchema.shape);
4343

4444
export const userExperienceWorkSchema = z

0 commit comments

Comments
 (0)