64 lines
1.3 KiB
Markdown
64 lines
1.3 KiB
Markdown
# `PATCH /number/{id}`
|
|
|
|
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
|
|
|
Update number sequence
|
|
|
|
Updates sequence settings for the selected company. Only provided fields
|
|
are changed (`prefix`, `padding`, `next`). `prefix` is trimmed and must
|
|
be at most 50 characters. `padding` must be an integer `>= 0`. `next`
|
|
must be an integer `>= 1`. If no field is provided, the row is returned
|
|
unchanged.
|
|
|
|
|
|
## Path parameters
|
|
|
|
| Param | Required | Type | Description |
|
|
|-------|----------|------|-------------|
|
|
| `id` | yes | integer | |
|
|
|
|
## Body (JSON)
|
|
|
|
| Field | Required | Type | Description |
|
|
|-------|----------|------|-------------|
|
|
| `prefix` | no | string | |
|
|
| `padding` | no | integer | |
|
|
| `next` | no | integer | |
|
|
|
|
```json
|
|
{
|
|
"prefix": "A-",
|
|
"padding": 4,
|
|
"next": 100
|
|
}
|
|
```
|
|
|
|
## Response `200`
|
|
|
|
Updated number sequence
|
|
|
|
```json
|
|
{
|
|
"number": {
|
|
"id": 1,
|
|
"type": "…",
|
|
"prefix": "…",
|
|
"padding": 1,
|
|
"next": 1
|
|
}
|
|
}
|
|
```
|
|
|
|
## Errors
|
|
|
|
| Status | Description |
|
|
|--------|-------------|
|
|
| 400 | Invalid number, invalid id, or no company selected — `{"error":"…"}` |
|
|
| 401 | Unauthorized — `{"error":"…"}` |
|
|
| 403 | Not authorized — `{"error":"…"}` |
|
|
| 404 | Number sequence or company not found — `{"error":"…"}` |
|
|
|
|
---
|
|
|
|
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|