Files
dashback/docs/api/routes/carrier/_id.patch.md
2026-10-17 05:10:25 +02:00

1.3 KiB

PATCH /carrier/{id}

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

Update carrier

Updates carrier name, sort order, hasPackages, and/or isReverse for the selected company.

Path parameters

Param Required Type Description
id yes integer Carrier ID

Body (JSON)

Field Required Type Description
name no string
sort no integer
hasPackages no boolean
isReverse no boolean
{
  "name": "…",
  "sort": 1,
  "hasPackages": true,
  "isReverse": true
}

Signals

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

Response 200

Updated carrier

{
  "carrier": {
    "id": 1,
    "name": "…",
    "sort": 1,
    "hasPackages": true,
    "isReverse": true
  }
}

Errors

Status Description
400 Invalid input or missing fields — {"error":"…"}
401 Unauthorized — {"error":"…"}
403 Not authorized — {"error":"…"}
404 Carrier not found — {"error":"…"}
409 Carrier already exists — {"error":"…"}

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