You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2.3 KiB
2.3 KiB
+++ title = "Implement PUT /api/quotes — create quote, generate UUID v4 ID, generate auth_code if not provided, return 201 with auth_code" priority = 5 status = "todo" ticket_type = "task" dependencies = ["a5049d", "d792e2", "03bb91", "175382", "7a0d9f"] +++
The `quotesdb` API is built with Axum + Tokio, targeting Cloudflare Workers via `workers-rs`. It serves JSON at `/api/*` endpoints and persists data to Cloudflare D1 (production) or a local SQLite file via Turso (development). Source lives in `src/bin/api/`.Shared types and utilities are in src/lib.rs — code placed there must compile for both the host target and wasm32-unknown-unknown.
PUT /api/quotes creates a new quote. The request body is JSON; auth_code is optional — if omitted, one is generated. The response is 201 with the full quote object and the auth_code (always returned so the user can save it).
Request body: { text, author, source?, tags?, date?, auth_code? }
Response 201: { quote: {...}, auth_code: "word-word-word-word" }
cargo fmt
cargo check
cargo clippy
cargo test
`feat(quotesdb): implement PUT /api/quotes — create quote with UUID v4 and auth_code`