Skip to content

fix: gate mail preview + remove dead category route#553

Merged
tompscanlan merged 2 commits intomainfrom
fix/quick-wins-march-6
Mar 8, 2026
Merged

fix: gate mail preview + remove dead category route#553
tompscanlan merged 2 commits intomainfrom
fix/quick-wins-march-6

Conversation

@tompscanlan
Copy link
Copy Markdown
Contributor

Summary

  • om-qfr3: Gate mail preview endpoint behind TestOnlyGuard + ApiExcludeController, split into MailPreviewModule conditionally loaded in non-production (matching TestHelpersModule pattern). Mail service remains available in all environments.
  • om-3f68: Remove dead GET /categories/:id route that caused 500 errors when slugs were passed (NaN coercion). Never called by frontend since PR chore: changed all endpoints to slug oriented (group,event,user) #143 (Nov 2024).

Test plan

  • Mail controller tests: verify TestOnlyGuard and ApiExcludeController metadata applied
  • Category controller tests: verify findOne route no longer exists
  • All mail + category tests pass (64/64)

The GET /api/mail/preview endpoint was completely open in production.
Add TestOnlyGuard and ApiExcludeController decorators, and split
MailController into a separate MailPreviewModule that is only loaded
in non-production environments (matching TestHelpersModule pattern).

Closes om-qfr3
The findOne route only supported numeric ID lookups, causing 500 errors
when slugs were passed (NaN coercion). The endpoint was never called by
the frontend (dead code since PR #143, Nov 2024). Remove it entirely.

Closes om-3f68
@tompscanlan tompscanlan merged commit a80b26c into main Mar 8, 2026
4 checks passed
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