diff --git a/README.md b/README.md index db07c9f..e6ed854 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ Backend mapping: | `createUnderParent` | `({ googleAuthId, parentId, name })` | `{ id, parentId, sort, name }` | | `delete` | `({ googleAuthId, id })` | `void` — blocked by FK if `categoryarticle` or child categories remain | | `getTreeForCompany` | `(googleAuthId, companyId)` | `{ languageId, tree, articles }` | -| `getCategoryArticles` | `(googleAuthId, categoryId)` | `{ id, sku, name, slug, net, taxRate, optionsCount, articleListCount, childCount, fatherArticleId, fatherSku, thumbW, thumbH, thumbHash }[]` | +| `getCategoryArticles` | `(googleAuthId, categoryId)` | `{ id, sku, name, slug, net, taxRate, optionsCount, articleListCount, childCount, fatherArticleId, fatherSku, fullHash, thumbW, thumbH, thumbHash }[]` | ### `createUnderParent` (transaction) @@ -181,7 +181,7 @@ Backend mapping: } ``` -`getCategoryArticles` / `getTreeForCompany().articles[]` keep the flat list shape (`net`, `taxRate`, single `thumbW`/`thumbH`/`thumbHash`). +`getCategoryArticles` / `getTreeForCompany().articles[]` keep the flat list shape (`net`, `taxRate`, single `fullHash`/`thumbW`/`thumbH`/`thumbHash`). `parentId` is the category id. Creates `article` + `articletext` (company default language) + `categoryarticle` in one transaction. Allocates `sku` via `getnextnumberwithprefixandpadding` (`type` `sku`; creates `numbers` row with empty prefix if missing). Default unit `pc` is ensured if missing (`unitamount` 1, `weight` 0). Auth via `resolveCategoryAccess(googleAuthId, parentId)` — `Parent not found` / `Not authorized`. diff --git a/src/sql/article.js b/src/sql/article.js index ebc7694..49f8951 100644 --- a/src/sql/article.js +++ b/src/sql/article.js @@ -46,6 +46,7 @@ export const ARTICLE_LIST_COLUMNS = ` ) AS childCount, a.fatherarticle_id AS fatherArticleId, father.sku AS fatherSku, + pic.hash AS fullHash, pic.thumbw AS thumbW, pic.thumbh AS thumbH, pic.thumbhash AS thumbHash diff --git a/src/sql/articleDetail.js b/src/sql/articleDetail.js index 169e442..81695dc 100644 --- a/src/sql/articleDetail.js +++ b/src/sql/articleDetail.js @@ -65,6 +65,9 @@ export const GET_PHOTOS_BY_ARTICLE_ID = ` SELECT ap.sort, p.hash AS fullHash, + p.w AS fullW, + p.h AS fullH, + p.size AS fullSize, p.thumbw AS thumbW, p.thumbh AS thumbH, p.thumbhash AS thumbHash