@omniumretail/component-library 1.2.80 → 1.2.81
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.
|
@@ -1404,9 +1404,11 @@ const CategorySidebar = (props) => {
|
|
|
1404
1404
|
return;
|
|
1405
1405
|
}
|
|
1406
1406
|
if (questions && questions.length > 0) {
|
|
1407
|
+
console.log("you cant add a subcategory to a category with questions");
|
|
1407
1408
|
return;
|
|
1408
1409
|
}
|
|
1409
1410
|
if (dropPos.length > 4) {
|
|
1411
|
+
console.log("cant have more than 3 levels");
|
|
1410
1412
|
return;
|
|
1411
1413
|
}
|
|
1412
1414
|
const loop = (data3, key, callback) => {
|
|
@@ -1452,7 +1454,7 @@ const CategorySidebar = (props) => {
|
|
|
1452
1454
|
}
|
|
1453
1455
|
function generateCategoryKeys(categories, parentKey = "") {
|
|
1454
1456
|
return categories.map((category2, index) => {
|
|
1455
|
-
const categoryKey = parentKey ? `${parentKey}.${index + 1}` : `${index + 1}`;
|
|
1457
|
+
const categoryKey = parentKey ? `${parentKey}.${index + 1}` : `${index - 1 + 1}`;
|
|
1456
1458
|
let children = [];
|
|
1457
1459
|
if (category2.children) {
|
|
1458
1460
|
children = generateCategoryKeys(category2.children, categoryKey);
|