- Add POST /api/ebooks for creating new ebook entries - Add PUT /api/ebooks/:id for updating existing ebook metadata - Add DELETE /api/ebooks/:id for deleting ebooks from database - Include complete request/response examples with all metadata fields - Support file path, metadata, and publication information updates
53 lines
1.1 KiB
Plaintext
53 lines
1.1 KiB
Plaintext
meta {
|
|
name: Delete Ebook
|
|
type: http
|
|
seq: 10
|
|
}
|
|
|
|
delete {
|
|
url: {{base_url}}/api/ebooks/{{ebook_id}}
|
|
body: none
|
|
auth: inherit
|
|
}
|
|
|
|
settings {
|
|
encodeUrl: true
|
|
timeout: 0
|
|
}
|
|
|
|
docs {
|
|
## Delete Ebook
|
|
|
|
Deletes an ebook from the database.
|
|
|
|
**Method:** DELETE
|
|
|
|
**Endpoint:** /api/ebooks/:id
|
|
|
|
**Authentication:** Required (Admin only)
|
|
|
|
**Path Parameters:**
|
|
- `id` (string): Ebook ID (UUID)
|
|
|
|
**Response:** No content (204) or success message
|
|
|
|
**Status Codes:**
|
|
- 204: Ebook deleted successfully (no content)
|
|
- 400: Bad request (invalid ID format)
|
|
- 401: Unauthorized
|
|
- 403: Forbidden (admin access required)
|
|
- 404: Ebook not found
|
|
- 500: Internal server error
|
|
|
|
**Features:**
|
|
- Admin-only endpoint for deleting ebooks
|
|
- Permanent deletion (cannot be undone)
|
|
- Cascades to delete related data (reading progress, ratings)
|
|
- Requires valid UUID format for ebook ID
|
|
|
|
**Important Notes:**
|
|
- This is a destructive operation
|
|
- All user reading progress for this ebook will be lost
|
|
- All user ratings for this ebook will be lost
|
|
- Use with caution
|
|
} |