Skip to content

Fix map app typecheck errors introduced by OrgInsertSchema nullable field changes#145

Closed
Copilot wants to merge 2 commits intodevfrom
copilot/fix-typecheck-errors-map-app
Closed

Fix map app typecheck errors introduced by OrgInsertSchema nullable field changes#145
Copilot wants to merge 2 commits intodevfrom
copilot/fix-typecheck-errors-map-app

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 22, 2026

PR #142 added nullable overrides (description, website, twitter, facebook, instagram, email) to OrgInsertSchema, which tightened those field types from string | null | undefined to string | null. Since org.crupdate uses OrgInsertSchema as its input, the mutation's inferred input type no longer accepted undefined for these fields — but the specific org schemas used in the map app forms (AOInsertSchema, AreaInsertSchema, RegionInsertSchema, SectorInsertSchema, NationInsertSchema) were not updated, leaving them typed as optional (string | null | undefined). TypeScript flagged the mismatch at every mutateAsync call site.

Changes

  • packages/validators/src/index.ts
    • Applies PR New routes for event-instance, attendance, and event-tags #142's validator additions: eventTags/slackSpaces/slackUsers imports, EventTag schemas, eventTagIds on EventInsertSchema, OrgInsertSchema nullable overrides, and Slack schemas
    • Adds the same nullable overrides (description, email, website, twitter, facebook, instagram) to all five specific org schemas so their inferred types match OrgInsertSchema
// Before — description typed as string | null | undefined (optional)
export const AOInsertSchema = createInsertSchema(orgs, {
  name: (s) => s.min(1, { message: "Name is required" }),
  parentId: z.number().nonnegative(...),
  email: (s) => s.email(...).or(z.literal("")),
}).omit({ orgType: true });

// After — aligns with OrgInsertSchema so form data satisfies mutation input
export const AOInsertSchema = createInsertSchema(orgs, {
  name: (s) => s.min(1, { message: "Name is required" }),
  parentId: z.number().nonnegative(...),
  email: (s) => s.email(...).or(z.literal("")).nullable(),
  description: (s) => s.nullable(),
  website: (s) => s.nullable(),
  twitter: (s) => s.nullable(),
  facebook: (s) => s.nullable(),
  instagram: (s) => s.nullable(),
}).omit({ orgType: true });
  • packages/api/src/router/org.test.ts / packages/api/src/lib/webhook-events.test.ts — updates org.crupdate call sites to explicitly pass description: null, website: null, twitter: null, facebook: null, instagram: null (matching the updated input type, mirrors PR New routes for event-instance, attendance, and event-tags #142's test changes)

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Feb 22, 2026
…fic org schemas

Co-authored-by: taterhead247 <26818765+taterhead247@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix typecheck errors in map app caused by PR 142 Fix map app typecheck errors introduced by OrgInsertSchema nullable field changes Feb 22, 2026
Copilot AI requested a review from taterhead247 February 22, 2026 04:02
@evanpetzoldt evanpetzoldt deleted the copilot/fix-typecheck-errors-map-app branch February 24, 2026 13:15
@taterhead247 taterhead247 moved this from Merged to Cancelled in F3 Nation Tech Pull Requests Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Cancelled

Development

Successfully merging this pull request may close these issues.

2 participants