This commit is contained in:
seb
2026-10-09 10:42:24 +02:00
parent 1933ac794d
commit 38339b13a2
8 changed files with 353 additions and 37 deletions

View File

@@ -6,7 +6,7 @@
* Everything is created through the existing dashback API:
* - categories: POST /api/category ({ parentId, name })
* - brands: PUT /api/brand ({ name }) → { brand: { id } }
* - articles: POST /api/article ({ parentId, name }) → { article: { sku } }
* - articles: POST /api/article ({ categoryId, name }) → { article: { sku } }
* - price: PUT /api/article/:sku/prices ({ prices: [{ price, tax }] })
* - brand: PUT /api/article/:sku/brand ({ brandId })
* - eans: PUT /api/article/:sku/eans ({ eans })
@@ -142,7 +142,7 @@ async function importRow(row, { ensureCategory, ensureBrand }) {
const brandId = row.brand ? await ensureBrand(row.brand) : null;
// Create the article under the leaf category.
const createRes = await article.create({ parentId: leafCategoryId, name });
const createRes = await article.create({ categoryId: leafCategoryId, name });
requireObject(createRes, 'POST /api/article');
const created = createRes.article;
requireDefined(created, 'article');