info:
  name: Update Dashboard Preferences
  type: http
  seq: 2
http:
  method: PUT
  url: '{{base_url}}/api/dashboard/preferences'
  auth: inherit
  body:
    type: json
    jsonBody: "{\n  \"library_id\": \"{{library_id}}\",\n  \"hidden_collections\"\
      : [\"not-started\"],\n  \"collection_order\": [\"recently-added\", \"continue-reading\"\
      , \"recently-read\"],\n  \"items_per_section\": 20\n}"
runtime:
  scripts:
  - type: tests
    code: "test(\"status must be 200 with valid request\", function() {\n    expect(res.status).to.eql(200);\n\
      });"

docs: |-
  Update dashboard preferences for the authenticated user.

  **Endpoint**: PUT /api/dashboard/preferences
  **Auth**: Required (Bearer token)

  ## Request Body

  | Field | Type | Required | Description |
  |-------|------|----------|-------------|
  | library_id | string | Yes | Library UUID |
  | hidden_collections | array | No | Collection names to hide from dashboard |
  | collection_order | array | No | Collection names in custom display order |
  | items_per_section | int | No | Items to show per section (default: 20) |

  ## Example Request

  ```json
  {
    "library_id": "cc23c3a7-f8fb-451a-a78d-2a16df1b725a",
    "hidden_collections": ["not-started"],
    "collection_order": ["recently-added", "continue-reading", "recently-read"],
    "items_per_section": 20
  }
  ```

  ## Response

  Returns updated preferences object on success.
