Skip to content

fix(admin): submissions list reads receivedAt, not missing createdAt - #6

Open
zumbrunn wants to merge 1 commit into
mainfrom
claude/modest-diffie-6acd6b
Open

fix(admin): submissions list reads receivedAt, not missing createdAt#6
zumbrunn wants to merge 1 commit into
mainfrom
claude/modest-diffie-6acd6b

Conversation

@zumbrunn

@zumbrunn zumbrunn commented Sep 2, 2026

Copy link
Copy Markdown
Member

Problem

The per-form submissions list at /admin/submissions/{form} rendered the timestamp column from s.createdAt — a field that does not exist on the Submission interface (src/admin/submissions.ts). The real timestamp field is receivedAt (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 reads receivedAt.

Fix

src/admin/routes/submissions/[form]/index.tsx:

  • new Date(s.createdAt)new Date(s.receivedAt)
  • local type annotation createdAt: numberreceivedAt: number

Checked the rest of src/admin/routes/submissions/ — the overall list route (submissions/index.tsx) has no date column, and there are no other .createdAt references.

Test

Adds tests/admin/submissions_list_test.tsx: renders the route with a submission whose receivedAt is set and asserts the output contains a valid formatted date, not "Invalid Date".

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant