Files
bookhoard/bruno/books/Bulk Delete Books.bru
T
john-okeefe b364aee631 test(bruno): update API tests for /api/media-items/ endpoints
- Update bulk-delete test: endpoint URL, request field (book_ids → media_item_ids), response field (success → deleted), documentation
- Update bulk-update test: endpoint URL, request structure (updates → media_item_updates), response field (success → updated), documentation
- Update download test: endpoint URL (/api/books/ → /api/media-items/), documentation
2026-02-10 19:58:41 -05:00

86 lines
1.7 KiB
Plaintext

meta {
name: Bulk Delete Media Items
type: http
seq: 1
}
post {
url: {{base_url}}/api/media-items/bulk-delete
body: json
auth: inherit
}
headers {
Content-Type: application/json
}
body:json {
{
"media_item_ids": [
"{{bookId1}}",
"{{bookId2}}",
"{{bookId3}}"
]
}
}
script:post-response {
function onResponse(res) {
if (res.getStatus() === 200) {
tests['Bulk delete successful'] = true;
const body = res.getBody();
tests['Has results array'] = Array.isArray(body.results);
tests['Has total count'] = body.total !== undefined;
tests['Has deleted count'] = body.deleted !== undefined;
tests['Has failed count'] = body.failed !== undefined;
} else {
tests['Bulk delete failed'] = false;
}
}
onResponse(res);
}
settings {
encodeUrl: true
timeout: 0
}
docs {
## Bulk Delete Media Items
Deletes multiple media items in a single request.
**Method:** POST
**Endpoint:** /api/media-items/bulk-delete
**Authentication:** Required (Bearer token)
**Request Body:**
- `media_item_ids` (array of strings): Array of media item UUIDs to delete
**Response:**
- `results` (array): Results for each deletion attempt
- `total` (number): Total number of media items processed
- `deleted` (number): Number of successfully deleted media items
- `failed` (number): Number of failed deletions
**Status Codes:**
- 200: Success (with partial results if some failed)
- 400: Invalid request data
- 401: Unauthorized
- 403: Forbidden
- 500: Internal server error
**Example:**
```json
{
"media_item_ids": [
"uuid-1",
"uuid-2",
"uuid-3"
]
}
```
}