Skip to content

Add endDate to event API responses#111

Draft
Copilot wants to merge 7 commits intodevfrom
copilot/add-enddate-to-event-route
Draft

Add endDate to event API responses#111
Copilot wants to merge 7 commits intodevfrom
copilot/add-enddate-to-event-route

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 6, 2026

The /event endpoints were returning startDate, startTime, and endTime but omitting endDate despite it existing in the database schema as public.events.end_date.

Changes

  • Added endDate field to event response schemas in both all and byId endpoints
  • Field returns the date string when present or null when absent
const select = {
  id: schema.events.id,
  name: schema.events.name,
  startDate: schema.events.startDate,
  endDate: schema.events.endDate,  // Added
  startTime: schema.events.startTime,
  endTime: schema.events.endTime,
  // ...
};

The field is now consistently available for filtering and display alongside the existing date/time fields.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add endDate to /event</issue_title>
<issue_description>The responses in the API for /event include startDate, startTime, and endTime. It does not include endDate. This is important for filtering.

Every endpoint in packages/api/src/router/event.ts that returns startDate should also include endDate. This value will come from the database public.events.end_date. It is a nullable field.</issue_description>

<agent_instructions>Can you please make sure endDate is returned in all relavent responses from /event?</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: taterhead247 <26818765+taterhead247@users.noreply.github.com>
Copilot AI changed the title [WIP] Add endDate to /event API responses Add endDate to event API responses Feb 6, 2026
Copilot AI requested a review from taterhead247 February 6, 2026 15:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds the endDate field to event API responses in the /event endpoints. The field was previously missing despite existing in the database schema as a nullable date field.

Changes:

  • Added endDate field to the event.all endpoint response
  • Added endDate field to the event.byId endpoint response
  • Added comprehensive test coverage for the byId endpoint to verify endDate handling for both null and non-null values

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/api/src/router/event.ts Added endDate field to select statements in both all and byId endpoints, positioned consistently after startDate
packages/api/src/router/event.test.ts Added tests to verify endDate field is returned correctly for events with and without end dates

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Draft

Development

Successfully merging this pull request may close these issues.

Add endDate to /event

3 participants