fix(admin): submissions list reads receivedAt, not missing createdAt - #6
Open
zumbrunn wants to merge 1 commit into
Open
fix(admin): submissions list reads receivedAt, not missing createdAt#6zumbrunn wants to merge 1 commit into
zumbrunn wants to merge 1 commit into
Conversation
The per-form submissions list at /admin/submissions/{form} rendered the
timestamp from `s.createdAt`, a field that does not exist on the
`Submission` interface (the timestamp is `receivedAt`, Unix ms). Every
row showed "Invalid Date". Confirmed live: a real submission with
`"receivedAt": 1788249949694` rendered "Invalid Date" in the list (the
detail route was unaffected — it already uses `receivedAt`).
The overall list route (submissions/index.tsx) has no date column, and
no other `.createdAt` references exist under routes/submissions/.
Adds a regression test rendering the route with a set `receivedAt` and
asserting the output contains a valid formatted date, not "Invalid Date".
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Problem
The per-form submissions list at
/admin/submissions/{form}rendered the timestamp column froms.createdAt— a field that does not exist on theSubmissioninterface (src/admin/submissions.ts). The real timestamp field isreceivedAt(Unix ms). Result: every row showed "Invalid Date".Confirmed live: submitted a real form (europa-magazin's
/join, via this plugin's forms module); the stored JSON correctly had"receivedAt": 1788249949694, but the list view showed "Invalid Date". The detail route was unaffected — it already readsreceivedAt.Fix
src/admin/routes/submissions/[form]/index.tsx:new Date(s.createdAt)→new Date(s.receivedAt)createdAt: number→receivedAt: numberChecked the rest of
src/admin/routes/submissions/— the overall list route (submissions/index.tsx) has no date column, and there are no other.createdAtreferences.Test
Adds
tests/admin/submissions_list_test.tsx: renders the route with a submission whosereceivedAtis set and asserts the output contains a valid formatted date, not "Invalid Date".🤖 Generated with Claude Code