Files
2026-09-30 19:29:13 +02:00

1.2 KiB

PUT /category/order

Protected. Requires a valid session cookie (credentials: 'include').

Reorder sibling categories

Sets the sibling sort order of categoryIds under parentId. categoryIds must be exactly the current child set of parentId (same count, no foreign/duplicate ids). Each child's sort is set to its index 0..n-1 in one transaction.

Body (JSON)

Field Required Type Description
parentId yes integer Parent category under which sibling order applies
categoryIds yes integer[]
{
  "parentId": 1,
  "categoryIds": [
    2,
    4,
    3,
    5
  ]
}

Signals

On success, emits SSE signal: category (see GET /events).

Response 200

New sibling order

{
  "categoryIds": [
    1
  ]
}

Errors

Status Description
400 Invalid category order — {"error":"…"}
401 Unauthorized — {"error":"…"}
403 Not authorized — {"error":"…"}
404 Parent category not found — {"error":"…"}

Generated from @openapi JSDoc. Do not edit by hand — run npm run docs:api.