Skip to content
SprecherEast
Issue 356

Search: fix a wrong comment, use documentHref on the post page, test the query's collection

Back to our plan
Open
frontendtech-debtpriority: lowneeds grooming

Problem

Three small leftovers from review 5639495077 / 5639510653 on #349 (search fix, #200):

  1. The populate comment in findSearchResults (src/modules/news/) says the linked post or event isn't loaded. With depth: 1, Payload loads each one's slug, so the comment is wrong.
  2. src/app/(frontend)/posts/[slug]/page.tsx:46 builds '/posts/' + decodedSlug by hand for the redirect lookup instead of the shared documentHref('posts', decodedSlug) (DRY rule in docs/guidelines/development.md).
  3. No test checks that the search query returns each entry's collection, which the result href depends on.

Acceptance criteria

  • The comment says what the query actually loads.
  • The post page uses documentHref for the redirect lookup, with the same URL as before.
  • A test fails if the search query stops returning the entry's collection.

Generated by Claude Code, opens in a new tab

See it on GitHub, opens in a new tab