Nobody has started this yet — be first.
Business impact
A user who wants to start their saved-city list over (or is resetting a demo/test account) has to DELETE /cities/{id} one at a time for every city they've saved -- tedious, and it's an extra round trip per city for something that's conceptually one action ("clear my list").
Problem
cities.Store supports deleting one city by id (Delete(ctx, userID, id)). There is no bulk-delete operation and no DELETE /cities (collection-level) route -- calling it returns 405 Method Not Allowed.
Current behavior
DELETE /cities (with no id) returns 405 Method Not Allowed; clearing a saved-city list requires one DELETE /cities/{id} call per city.
Expected behavior
DELETE /cities removes every saved city belonging to the requesting user (per the existing X-User-ID-based scoping) in a single call, and responds with how many were removed. Deleting an empty list is not an error -- it just reports zero removed.
Steps to reproduce
curl -X POST http://localhost:8083/cities -H 'X-User-ID: alice' -d '{"name": "London"}' curl -X DELETE http://localhost:8083/cities -H 'X-User-ID: alice'
Why this matters
This is a genuinely different SQL shape from the existing single-row Delete -- a DELETE ... WHERE user_id = $1 with no id condition at all, still scoped correctly by user, still using RowsAffected() to report how many rows were actually removed (same pattern as the single-row delete, just without the id clause).
Suggested approach
Add a Store method (e.g. DeleteAll(ctx, userID) (int64, error)) mirroring Delete's shape minus the id condition; wire a DELETE /cities route and handler alongside the existing DELETE /cities/{id} one in server.go/handlers.go.
Acceptance criteria
Verification
WD_TEST_DATABASE_URL=postgresql://... go test ./practicetickets/... -run TestTicket03 -v
Hints (0/2)
Try it without hints first — the reading is the exercise.
Working on this ticket
Work on a branch named for the ticket — that's what you'll submit.
Branch off your fork
$git checkout -b feat/delete-all-citiesFix it and commit
Meet every acceptance criterion, and add a test that would have caught this.
Push the branch
$git push -u origin feat/delete-all-citiesSubmit it below
Paste your fork URL and the branch name, with a short write-up of the root cause.
Questions
Ask about anything unclear in the ticket — the maintainer and anyone who has solved it can answer. Please don't post full solutions.
Sign in to ask a question or reply.
Sign inweather_dashboarddbappmockweatherWEATHER_API_BASE_URL=https://api.openweathermap.orgWEATHER_API_KEYdocker-compose.prod.ymlRun the project's own test suite:
make test # go test ./...
make test-race # go test -race ./... (includes the concurrency/partial-failure test)
Work the tickets in PRACTICE_TICKETS.md (TICKET-01 through TICKET-10); each names one Go test in practicetickets/:
./practice_tickets_run.sh # all 10, pass/fail summary
go test ./practicetickets/... -run TestTicket01 -v # a single ticket
go test -race ./practicetickets/... -run TestTicket10 -v # ticket 10 needs -race to observe its bug
Tickets 03, 04, 05, and 06 touch the saved-cities Postgres store and need a reachable test database, set via WD_TEST_DATABASE_URL (defaults to postgres://postgres:postgres@localhost:5436/weather_dashboard_test if unset). Tickets 01, 02, 07, 08, 09, and 10 need no database at all.
Level 2
Implement a feature
Extend the system within its own patterns.