Skip to content

Copilot/fix typecheck errors map app#146

Merged
evanpetzoldt merged 2 commits intoroutes-instance-att-tagfrom
copilot/fix-typecheck-errors-map-app
Feb 24, 2026
Merged

Copilot/fix typecheck errors map app#146
evanpetzoldt merged 2 commits intoroutes-instance-att-tagfrom
copilot/fix-typecheck-errors-map-app

Conversation

@taterhead247
Copy link
Copy Markdown
Contributor

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 and others added 2 commits February 22, 2026 03:48
…fic org schemas

Co-authored-by: taterhead247 <26818765+taterhead247@users.noreply.github.com>
@taterhead247
Copy link
Copy Markdown
Contributor Author

@evanpetzoldt AI found what was breaking typecheck. Can you please see if this messes up any of your stuff? if not, we can merge it into your branch/PR and then get it into dev after positive testing.

@taterhead247 taterhead247 moved this from Draft to Initiated in F3 Nation Tech Pull Requests Feb 24, 2026
Copy link
Copy Markdown
Collaborator

@evanpetzoldt evanpetzoldt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM FWIK

@evanpetzoldt evanpetzoldt merged commit 4634e21 into routes-instance-att-tag Feb 24, 2026
@evanpetzoldt evanpetzoldt deleted the copilot/fix-typecheck-errors-map-app branch February 24, 2026 13:15
@github-project-automation github-project-automation bot moved this from Initiated to Merged in F3 Nation Tech Pull Requests Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

3 participants