Skip to content

Commit 67f96d3

Browse files
authored
fix: nullable links (#3291)
1 parent 5925671 commit 67f96d3

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/common/schema/organizations.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,18 @@ export const organizationSubscriptionFlagsSchema = z.object({
3939
});
4040

4141
const linksSchemaBase = {
42-
title: z.string(),
42+
title: z.string().nullable(),
4343
link: z.url(),
4444
};
4545

4646
export const organizationLinksSchema = z.discriminatedUnion('type', [
4747
z.object({
4848
type: z.literal(OrganizationLinkType.Social),
49-
socialType: z.enum(SocialMediaType, {
50-
error: 'Invalid social media type',
51-
}),
49+
socialType: z
50+
.enum(SocialMediaType, {
51+
error: 'Invalid social media type',
52+
})
53+
.nullable(),
5254
...linksSchemaBase,
5355
}),
5456
z.object({

src/schema/opportunity.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ export const typeDefs = /* GraphQL */ `
389389
input OrganizationLinkInput {
390390
type: OrganizationLinkType!
391391
socialType: SocialMediaType
392-
title: String!
392+
title: String
393393
link: String!
394394
}
395395

0 commit comments

Comments
 (0)