@propeller-commerce/propeller-v2-react-ui 0.15.4 → 0.15.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/index.cjs +7 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1572,15 +1572,15 @@ function buildCategoriesQuery(depth) {
|
|
|
1572
1572
|
categories {
|
|
1573
1573
|
categoryId
|
|
1574
1574
|
hidden
|
|
1575
|
-
names
|
|
1576
|
-
slugs
|
|
1575
|
+
names { value language }
|
|
1576
|
+
slugs { value language }
|
|
1577
1577
|
${buildCategoriesQuery(depth - 1)}
|
|
1578
1578
|
}
|
|
1579
1579
|
`;
|
|
1580
1580
|
}
|
|
1581
1581
|
function mapCategory(raw, language) {
|
|
1582
1582
|
const nameEntry = raw.names?.find((n) => n.language === language) ?? raw.names?.[0];
|
|
1583
|
-
const slugEntry = raw.slugs?.[0];
|
|
1583
|
+
const slugEntry = raw.slugs?.find((s) => s.language === language) ?? raw.slugs?.[0];
|
|
1584
1584
|
return {
|
|
1585
1585
|
categoryId: raw.categoryId,
|
|
1586
1586
|
name: nameEntry?.value ?? "",
|
|
@@ -1656,17 +1656,17 @@ function useMenu(options) {
|
|
|
1656
1656
|
inflightFetches.set(key, promise);
|
|
1657
1657
|
try {
|
|
1658
1658
|
const gql = `
|
|
1659
|
-
query Menu($categoryId: Float
|
|
1659
|
+
query Menu($categoryId: Float) {
|
|
1660
1660
|
category(categoryId: $categoryId) {
|
|
1661
1661
|
categoryId
|
|
1662
1662
|
hidden
|
|
1663
|
-
names
|
|
1664
|
-
slugs
|
|
1663
|
+
names { value language }
|
|
1664
|
+
slugs { value language }
|
|
1665
1665
|
${buildCategoriesQuery(depth)}
|
|
1666
1666
|
}
|
|
1667
1667
|
}
|
|
1668
1668
|
`;
|
|
1669
|
-
const variables = { categoryId: rootCategoryId
|
|
1669
|
+
const variables = { categoryId: rootCategoryId };
|
|
1670
1670
|
const data = await graphqlClient.query(gql, variables);
|
|
1671
1671
|
const root = data?.category ?? null;
|
|
1672
1672
|
const items = root ? (root.categories ?? []).filter((cat) => !isHidden(cat)).map((cat) => mapCategory(cat, language)) : [];
|