This commit is contained in:
seb
2026-07-31 18:20:54 +02:00
parent 63df454861
commit 1a05a5b7d6
5 changed files with 529 additions and 20 deletions

View File

@@ -56,8 +56,8 @@ export function register(app, basePath = '') {
/**
* @route GET /article/:sku
* @description Returns an article by SKU if the user may access its category.
* @returns {Object} 200 - `{ article }`
* @description Returns article detail by SKU if the user may access its category.
* @returns {Object} 200 - `{ article }` detail shape (`unit`, `brand`, `categoryIds`, `photos`, `eans`, `prices`, …)
*/
app.get(`${basePath}/article/:sku`, async (req, res) => {
const sku = typeof req.params.sku === 'string' ? req.params.sku.trim() : '';
@@ -77,9 +77,9 @@ export function register(app, basePath = '') {
/**
* @route PATCH /article/:sku
* @description Updates an article name by SKU if the user may access its category.
* @description Updates an article name by SKU; returns the same detail shape as GET.
* @body {string} name
* @returns {Object} 200 - `{ article }`
* @returns {Object} 200 - `{ article }` detail shape
*/
app.patch(`${basePath}/article/:sku`, async (req, res) => {
const sku = typeof req.params.sku === 'string' ? req.params.sku.trim() : '';