57 lines
945 B
Markdown
57 lines
945 B
Markdown
# `POST /attributename`
|
|
|
|
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
|
|
|
Create attribute name
|
|
|
|
Creates an attribute name for the selected company.
|
|
|
|
## Body (JSON)
|
|
|
|
| Field | Required | Type | Description |
|
|
|-------|----------|------|-------------|
|
|
| `name` | yes | string | |
|
|
| `sort` | no | integer | |
|
|
| `exclusive` | no | boolean | |
|
|
|
|
```json
|
|
{
|
|
"name": "…",
|
|
"sort": 1,
|
|
"exclusive": true
|
|
}
|
|
```
|
|
|
|
## Signals
|
|
|
|
On success, emits SSE signal: `attributename` (see [`GET /events`](../events.md)).
|
|
|
|
## Response `201`
|
|
|
|
Created attribute name
|
|
|
|
```json
|
|
{
|
|
"attributename": {
|
|
"id": 1,
|
|
"name": "…",
|
|
"sort": 1,
|
|
"exclusive": true,
|
|
"articleCount": 1,
|
|
"values": [
|
|
{
|
|
"id": 1,
|
|
"attributeId": 1,
|
|
"value": "…",
|
|
"sort": 1,
|
|
"articleCount": 1
|
|
}
|
|
]
|
|
}
|
|
}
|
|
```
|
|
|
|
---
|
|
|
|
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|