Repository navigation
fix(events): optional end time — label, min bound and tested payload (#286) - #341
Merged
presidojay1 merged 2 commits intoOct 15, 2026
Merged
Conversation
…yload helper (StellarTickets#286) Move the start/end validation and request fields into eventTimesPayload() so the 'endsAt sent only when set' behaviour is testable, label the field '(optional)' and set min={startsAt} so the picker can't choose an end before the start.
|
@gideononiru Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
❌ Deploy Preview for stellartickets failed.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
The issue says the organization page's create-event form only has "Starts at". On current
mainthe basic feature is actually already there:5052720("feat(events): add optional endsAt field on organization page (#100)", 2026-09-25) added an "Ends at"datetime-localfield, rejected an end at or before the start, and sentendsAtonly when set.Three things were still missing, and they are what keep #286 open:
handleCreate, so a later edit could dropendsAtfrom the request without any test failing.What changed
1.
fix(events)eventTimesPayload(startsAt, endsAt)insrc/lib/event-details.ts. It returns{ startsAt, endsAt? }(ISO strings, withendsAtonly when set) or{ error: 'Ends at must be after Starts at' }. The logic is the same as the previous inline code, moved into one testable function.organizations/[id]/page.tsxnow uses it (...timesin the POST body), so there is one source of truth for the validation and the request fields.min={startsAt}, so the native picker blocks earlier times. The submit-time check stays as the backstop.2.
test(events): three new tests insrc/lib/event-details.test.ts:endsAtis sent as ISO when it is set and after the startendsAtis omitted (notundefined, absent) when left emptyVerification
npx vitest run: 21 files, 87 tests, all pass (3 new).npx tsc --noEmit: no errors in the touched files.npx eslinton the touched files: clean.Closes #286
Closes #287
Closes #288
Closes #289