Beam backfilled 11 library docs (CRUD, folders, visibility, browse, stats,
media-items) and re-attached frontmatter to create_collection.md — which had
silently lost its pilot version in cc893f75: the negative-test
'git checkout --' restored the OLD file because the pilot was never staged,
and a frontmatter-less doc is invisible to the gate. Claude restored the full
corrected pilot content (priority higher-wins, time.String() note, 409).
Claude registry: 11 entries + one inverted catch — DELETE /:id/folders DOES
bind {folder_path} (handler reuses AddLibraryFolderRequest); registry first
draft said bodyless. GET /:id/visibility returns joined
GetUserVisibleLibrariesRow (type_name etc.), not bare Libraries.
Gate-driven merges fixed create/get library response shapes (sqlc row keys:
created_by_admin_id, library_type_id, updated_at; dropped invented type/
folders/is_visible). Fixed invented request fields (user_id in
set-visibility; library_type_id in update). make test 9/9.
61 lines
1.4 KiB
Markdown
61 lines
1.4 KiB
Markdown
---
|
|
method: PUT
|
|
path: /api/libraries/:id
|
|
auth: jwt+admin
|
|
area: libraries
|
|
---
|
|
<!-- source: internal/handlers/library.go:124 LibraryHandler.UpdateLibrary -->
|
|
|
|
# Update Library
|
|
|
|
Update a library's information.
|
|
|
|
**Endpoint**: `PUT /api/libraries/:id`
|
|
**Auth**: Required (Admin only)
|
|
**Content-Type**: `application/json`
|
|
|
|
## Path Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| --------- | ------------- | -------- | ------------ |
|
|
| id | string (UUID) | Yes | Library UUID |
|
|
|
|
## Request Body
|
|
|
|
| Field | Type | Required | Description |
|
|
| --------------- | ------- | -------- | --------------- |
|
|
| name | string | No | Library name |
|
|
| library_type_id | integer | No | Library type ID |
|
|
|
|
### Example Request
|
|
|
|
```json example-request
|
|
{
|
|
"name": "My Updated Library",
|
|
"description": "Updated description"
|
|
}
|
|
```
|
|
|
|
## Response (200 OK)
|
|
|
|
```json example-response
|
|
{
|
|
"id": "uuid",
|
|
"name": "My Updated Library",
|
|
"library_type_id": 1,
|
|
"created_at": "2026-02-08T10:00:00Z",
|
|
"updated_at": "2026-02-08T11:00:00Z",
|
|
"created_by_admin_id": null,
|
|
"description": null
|
|
}
|
|
```
|
|
|
|
## Error Responses
|
|
|
|
| Code | Description |
|
|
| ---- | ----------------------------------- |
|
|
| 400 | Invalid request data |
|
|
| 401 | Invalid or expired token |
|
|
| 403 | User does not have admin privileges |
|
|
| 404 | Library not found |
|