Add the Keep it in rotation card to Home (Feature 21)
Home shows the oldest pending Rotation check (GET /api/v1/rotation-reviews)
above the tiles: washed photo, "Last night: {dinner}", "Keep it in
rotation?" and Keep it / Not for us / We didn't make it. An answer posts
to /api/v1/dinners/{id}/rotation-review optimistically, confirms it and
reveals the next check; a failure puts the check back with an ErrorBanner.
Nothing is decided automatically.
Task: 4647eadf-4545-4d3f-849f-ffa5e9fcbd1b
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,7 @@ import { createNetworkStatus } from '../pwa/networkStatus.ts'
|
||||
import { HOME } from '../test/ApiProviders.tsx'
|
||||
import { errorResponse, fakeLocation, jsonResponse, ME } from '../test/fetchStub.ts'
|
||||
import { HOME_KEY, HOME_PATH, UPDATES_PATH, UPDATES_SEEN_PATH } from './api.ts'
|
||||
import { ROTATION_REVIEWS_PATH } from './rotation.ts'
|
||||
import { HomePage } from './HomePage.tsx'
|
||||
|
||||
afterEach(() => {
|
||||
@@ -52,6 +53,7 @@ function stubServer(responders: Record<string, Responder> = {}) {
|
||||
'GET /api/v1/me': () => jsonResponse(200, ME),
|
||||
[`GET ${HOME_PATH}`]: () => jsonResponse(200, { ...HOME, recentUpdates: { unread: !seen } }),
|
||||
[`GET ${UPDATES_PATH}`]: () => jsonResponse(200, UPDATES),
|
||||
[`GET ${ROTATION_REVIEWS_PATH}`]: () => jsonResponse(200, { reviews: [] }),
|
||||
[`POST ${UPDATES_SEEN_PATH}`]: () => {
|
||||
seen = true
|
||||
return new Response(null, { status: 204 })
|
||||
|
||||
Reference in New Issue
Block a user