Skip to content

Commit e507ed4

Browse files
committed
feat: added some product taxonomies
1 parent c4d2cf1 commit e507ed4

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

backend/editor/utils.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,20 @@ def file_cleanup(filepath):
1414
log.warn(f"Taxonomy file {filepath} not found for deletion")
1515

1616

17+
SPLIT_WITH_SLASH = {
18+
"food_ingredients",
19+
"food_categories",
20+
"beauty_categories",
21+
"beauty_labels",
22+
"product_categories",
23+
"product_labels",
24+
}
25+
26+
1727
def taxonomy_path_in_repository(taxonomy_name):
1828
"""Helper function to get the path of a taxonomy in the repository"""
1929
path = taxonomy_name
2030
# hacky for now until we restructure better
21-
if path in ("food_ingredients", "food_categories", "beauty_categories", "beauty_labels"):
31+
if path in SPLIT_WITH_SLASH:
2232
path = path.replace("_", "/")
2333
return f"taxonomies/{path}.txt"

taxonomy-editor-frontend/src/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,6 @@ export const TAXONOMY_NAMES = [
5252
"Vitamins",
5353
"Beauty Categories",
5454
"Beauty Labels",
55+
"Product Categories",
56+
"Product Labels",
5557
];

0 commit comments

Comments
 (0)