Update configuration key naming convention to use snake_case consistently. Applies changes recursively across all subdirectories.
53 lines
1.1 KiB
Plaintext
53 lines
1.1 KiB
Plaintext
meta {
|
|
name: Bulk Remove Books - Single Book
|
|
type: http
|
|
seq: 3
|
|
}
|
|
|
|
post {
|
|
url: {{base_url}}/api/collections/{{collection_id}}/books/bulk-remove
|
|
body: json
|
|
auth: inherit
|
|
}
|
|
|
|
headers {
|
|
Content-Type: application/json
|
|
Authorization: Bearer {{authToken}}
|
|
}
|
|
|
|
body:json {
|
|
{
|
|
"book_ids": [
|
|
"{{bookId1}}"
|
|
]
|
|
}
|
|
}
|
|
|
|
script:post-response {
|
|
function onResponse(res) {
|
|
if (res.getStatus() === 200) {
|
|
const body = res.getBody();
|
|
tests['Single book removed'] = body.removed === 1;
|
|
tests['Total is 1'] = body.total === 1;
|
|
}
|
|
}
|
|
onResponse(res);
|
|
}
|
|
|
|
settings {
|
|
encodeUrl: true
|
|
timeout: 0
|
|
}
|
|
|
|
docs {
|
|
## Bulk Remove Books - Single Book
|
|
|
|
Tests that bulk remove endpoint works correctly with a single book.
|
|
|
|
**Expected Result:** 200 OK with removed: 1, total: 1
|
|
|
|
**Purpose:** Verifies the bulk remove endpoint handles single-item arrays correctly, providing flexibility for clients to use the same endpoint for both single and multiple removals.
|
|
|
|
**Note:** Using bulk remove for a single book is functionally equivalent to the single remove endpoint but allows for consistent error handling and response format.
|
|
}
|