Add GET /api/v1/dinners/{id} dinner detail
Returns a dinner with its recipe for the recipe detail screen and Kitchen reading mode: photo URLs at both cached sizes (400/1200) or null, ingredients and steps in recipe position order, the source page for a fetched recipe, grounding status and error, and why_picked, the reason of the suggestion that created the dinner (null when none). Unknown and archived dinners are 404. Read in one transaction. Adds the GetDinnerSuggestionReason query (sqlc regenerated). The dinners test env now serves photos from the grounder's own store and data directory so photo URLs can be fetched in tests. Maestro task 099e9952-7f98-4700-8369-241c589a1e9d. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -572,7 +572,12 @@ func checkUnique(ctx context.Context, q *db.Queries, self, name string, recipeUR
|
||||
|
||||
// PhotoURL is where the API serves a list-sized copy of photo id.
|
||||
func PhotoURL(id string) string {
|
||||
return fmt.Sprintf("/media/photos/%s-%d.jpg", id, photoListWidth)
|
||||
return photoURL(id, photoListWidth)
|
||||
}
|
||||
|
||||
// photoURL is where the API serves photo id at stored width size.
|
||||
func photoURL(id string, size int) string {
|
||||
return fmt.Sprintf("/media/photos/%s-%d.jpg", id, size)
|
||||
}
|
||||
|
||||
func fromRow(r db.Dinner) Dinner {
|
||||
|
||||
Reference in New Issue
Block a user