This commit is contained in:
seb
2026-10-01 17:40:01 +02:00
parent 8a7500cb5a
commit 7383e13894
14 changed files with 660 additions and 1 deletions

View File

@@ -0,0 +1,38 @@
# `GET /category/{id}/attributevalue`
Protected. Requires a valid session cookie (`credentials: 'include'`).
List category attribute values
Fetches all attribute values assigned to a category.
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `id` | yes | integer | Category ID |
## Response `200`
List of attribute values assigned to this category
```json
{
"attributevalues": [
{
"id": 1,
"categoryId": 1,
"attributeId": 1,
"attributeName": "…",
"exclusive": true,
"attributeValueId": 1,
"value": "…",
"sort": 1
}
]
}
```
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,52 @@
# `PUT /category/{id}/attributevalue`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Bulk set category attribute values
Replaces all attribute values for a category. Enforces exclusive constraint (max one value per exclusive attribute).
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `id` | yes | integer | Category ID |
## Body (JSON)
| Field | Required | Type | Description |
|-------|----------|------|-------------|
| `attributevalues` | yes | any[] | Array of attribute value IDs (numbers) or objects with id or attributeValueId |
```json
{
"attributevalues": [
"…"
]
}
```
## Response `200`
Updated category attribute values
```json
{
"attributevalues": [
{
"id": 1,
"categoryId": 1,
"attributeId": 1,
"attributeName": "…",
"exclusive": true,
"attributeValueId": 1,
"value": "…",
"sort": 1
}
]
}
```
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,37 @@
# `GET /category/{id}/property`
Protected. Requires a valid session cookie (`credentials: 'include'`).
List category properties
Fetches all free-form properties set on a category.
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `id` | yes | integer | Category ID |
## Response `200`
List of properties for this category
```json
{
"properties": [
{
"id": 1,
"categoryId": 1,
"propertyId": 1,
"name": "…",
"exclusive": true,
"value": "…",
"sort": 1
}
]
}
```
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,58 @@
# `PUT /category/{id}/property`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Bulk set category properties
Replaces all properties for a category.
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `id` | yes | integer | Category ID |
## Body (JSON)
| Field | Required | Type | Description |
|-------|----------|------|-------------|
| `properties` | yes | object[] | |
| `properties[].propertyId` | yes | integer | |
| `properties[].value` | yes | string | |
| `properties[].sort` | no | integer | |
```json
{
"properties": [
{
"propertyId": 1,
"value": "…",
"sort": 1
}
]
}
```
## Response `200`
Updated category properties
```json
{
"properties": [
{
"id": 1,
"categoryId": 1,
"propertyId": 1,
"name": "…",
"exclusive": true,
"value": "…",
"sort": 1
}
]
}
```
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,22 @@
# `DELETE /category/{id}/property/{propertyId}`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Delete category property
Removes a single property from a category.
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `id` | yes | integer | |
| `propertyId` | yes | integer | |
## Response `200`
Deleted successfully
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._