Files
dashback/docs/api/routes/article/add-image.md
seb 782c49a680 Add article history by SKU and SSE update signals for live clients.
Expose getHistoryBySku as GET /article/:sku/history, and document mutation-emitted company signals via GET /events.
2026-08-05 09:54:56 +02:00

1.1 KiB
Raw Blame History

POST /article/{sku}/image

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

Add article image

Accepts a full-size AVIF body (Content-Type: image/avif). Full: stored as-is when already AVIF and ≤1000×1000; otherwise scaled to max 1000×1000. Thumb always scaled to max 200×200. Stores hash/thumbhash, links articlepic. Auth like GET by SKU.

Path parameters

Param Required Type Description
sku yes string Article SKU

Body

Raw binary (image/avif).

Signals

On success, emits SSE signal: article-<sku> (see GET /events).

Response 201

Image stored and linked

{
  "image": { … }
}

Errors

Status Description
400 Missing body or invalid image — {"error":"…"}
401 Unauthorized — {"error":"…"}
403 Not authorized — {"error":"…"}
404 Article not found — {"error":"…"}

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