docs for api routes :pf

This commit is contained in:
End 2025-12-17 11:14:43 -07:00
parent 76e4790142
commit b4ae3e0588
No known key found for this signature in database

View file

@ -9,3 +9,64 @@ bun run dev
```
open http://localhost:3000
## Endpoints
### Get all items
```
GET /api/wishlist
```
### Add an item
```
POST /api/wishlist
Content-Type: application/json
```
**Body:**
```json
{
"item": "Nintendo Switch",
"link": "https://amazon.com/...",
"price": 29999,
"priority": 1,
"category": "gaming",
"notes": "OLED version please!"
}
```
| Field | Type | Required |
|-------|------|----------|
| `item` | string | ✅ |
| `link` | string | ❌ |
| `price` | number | ❌ |
| `priority` | number | ❌ |
| `category` | string | ❌ |
| `notes` | string | ❌ |
### Claim an item
```
PATCH /api/wishlist/:id/claim
```
### Delete an item
```
DELETE /api/wishlist/:id
```
## Quick Examples
```bash
# Add item
curl -X POST http://localhost:3000/api/wishlist \
-H "content-type: application/json" \
-d '{"item":"PS5", "category":"gaming", "priority":1}'
# List all
curl http://localhost:3000/api/wishlist
# Claim item 1
curl -X PATCH http://localhost:3000/api/wishlist/1/claim
# Delete item 1
curl -X DELETE http://localhost:3000/api/wishlist/1