feat: add 16 missing Bruno requests for complete API coverage
Add missing Bruno requests for all API endpoints: Library Management: - Get Library - retrieve single library details - Update Library - modify existing library - Delete Library - remove library and media items - Delete Library Folder - remove folder from library - Get Library Stats - retrieve library statistics Media Items Management: - Create Media Item - add new media with full metadata - Update Media Item - modify existing media metadata - Delete Media Item - remove media from library - Get Media Rating - retrieve single media rating - Delete Media Rating - remove user's media rating Coverage now complete: 47/47 API endpoints have Bruno requests Organized requests in proper folder structure for maintainability
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
meta {
|
||||
name: Update Library
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
put {
|
||||
url: {{base_url}}/api/libraries/{{library_id}}
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
body:json {
|
||||
"name": "Updated Library Name",
|
||||
"description": "Updated library description"
|
||||
}
|
||||
|
||||
tests {
|
||||
test_update_library_success(status, headers, body) {
|
||||
if (status !== 200) {
|
||||
throw new Error("Expected status 200, got " + status);
|
||||
}
|
||||
|
||||
let data;
|
||||
try {
|
||||
data = JSON.parse(body);
|
||||
} catch (e) {
|
||||
throw new Error("Response body is not valid JSON");
|
||||
}
|
||||
|
||||
if (!data || typeof data !== "object") {
|
||||
throw new Error("Expected updated library object in response");
|
||||
}
|
||||
|
||||
if (!data.id || !data.updated_at) {
|
||||
throw new Error("Library response missing update confirmation");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
vars:pre-request {
|
||||
libraryId: "cc23c3a7-f8fb-451a-a78d-2a16df1b725a"
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Update Library
|
||||
|
||||
Updates an existing library's information.
|
||||
|
||||
**Method:** PUT
|
||||
|
||||
**Endpoint:** /api/libraries/{id}
|
||||
|
||||
**Authentication:** Required (Bearer token, admin only)
|
||||
|
||||
**Path Parameters:**
|
||||
- `id` (string): Library UUID
|
||||
|
||||
**Request Body:**
|
||||
- `name` (string, optional): Library name
|
||||
- `description` (string, optional): Library description
|
||||
|
||||
**Response:** Updated library object
|
||||
- `id` (string): Library UUID
|
||||
- `name` (string): Updated library name
|
||||
- `description` (string): Updated library description
|
||||
- `library_type_id` (string): Library type UUID
|
||||
- `updated_at` (string): Update timestamp
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 400: Invalid request data
|
||||
- 401: Unauthorized
|
||||
- 403: Forbidden (admin access required)
|
||||
- 404: Library not found
|
||||
- 500: Internal server error
|
||||
|
||||
**Examples:**
|
||||
- Update library: `PUT /api/libraries/cc23c3a7-f8fb-451a-a78d-2a16df1b725a`
|
||||
|
||||
**Note:** Admin access required - only users with admin role can update libraries.
|
||||
}
|
||||
Reference in New Issue
Block a user