u
This commit is contained in:
48
docs/api/routes/company/addHistory.md
Normal file
48
docs/api/routes/company/addHistory.md
Normal file
@@ -0,0 +1,48 @@
|
||||
# `POST /company/history`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Add company history entry
|
||||
|
||||
Appends an entry to `companyhistory` for the selected company.
|
||||
|
||||
|
||||
## Body (JSON)
|
||||
|
||||
| Field | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `text` | yes | string | History entry text or note |
|
||||
|
||||
```json
|
||||
{
|
||||
"text": "…"
|
||||
}
|
||||
```
|
||||
|
||||
## Response `201`
|
||||
|
||||
History entry created
|
||||
|
||||
```json
|
||||
{
|
||||
"history": {
|
||||
"id": 1,
|
||||
"companyuserId": 1,
|
||||
"date": "2026-08-10T00:00:00.000Z",
|
||||
"text": "…"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Text required or no company selected — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Forbidden — `{"error":"…"}` |
|
||||
| 500 | Server error — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
45
docs/api/routes/company/history.md
Normal file
45
docs/api/routes/company/history.md
Normal file
@@ -0,0 +1,45 @@
|
||||
# `GET /company/history`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Get company history
|
||||
|
||||
Returns `companyhistory` rows for the selected company, newest first (`date` DESC, `id` DESC).
|
||||
|
||||
|
||||
## Query parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `limit` | no | integer | Maximum number of entries to return (newest first). Omit for all entries. |
|
||||
|
||||
## Response `200`
|
||||
|
||||
Company history (newest first)
|
||||
|
||||
```json
|
||||
{
|
||||
"history": [
|
||||
{
|
||||
"id": 1,
|
||||
"companyuserId": 1,
|
||||
"date": "2026-08-10T00:00:00.000Z",
|
||||
"text": "…"
|
||||
}
|
||||
],
|
||||
"truncated": true
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Invalid limit or no company selected — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Forbidden — `{"error":"…"}` |
|
||||
| 500 | Server error — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
Reference in New Issue
Block a user