Skip to content

feat(gaming): look up a public game by slug - #223

Open
okapitula wants to merge 1 commit into
devfrom
feat/game-page-lovable
Open

okapitula wants to merge 1 commit into
devfrom
feat/game-page-lovable

Conversation

@okapitula

Copy link
Copy Markdown
Collaborator

Summary

Adds GET /gaming/games/by-slug/{slug}, a public lookup that returns the same GameSchema payload as GET /gaming/games/{id}.

Why

A game detail page is addressed by its slug, not its UUID. Before this, a frontend had to list games and filter them client-side to resolve a slug. The new route applies the same playability filter as the id route: an inactive or unplayable game returns 404, and a malformed slug returns 400.

Alternatives considered

  • A slug filter on the list route. Rejected: the list route is paginated and returns an array, so a detail page would have to unwrap it and handle an empty page itself.

Risks

None. This is an additive route. getGame now shares its lookup logic with getGameBySlug through a private findGame, and its behaviour is unchanged.

Add GET /gaming/games/by-slug/{slug}, returning the same payload as the
id route and 404ing inactive or unplayable games.
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