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.1 KiB
2.1 KiB
+++ title = "Implement PUT /api/quotes — create quote, generate NanoID, generate auth_code if not provided, return 201 with auth_code" priority = 5 status = "todo" ticket_type = "task" dependencies = ["f3dc74", "a5049d", "d792e2", "03bb91", "175382", "6f2e18"] +++
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 NanoID and auth_code`