Skip to content

Commit

Permalink
feat: first beauty and product taxonomies (#559)
Browse files Browse the repository at this point in the history
Added beauty categories and labels.
  • Loading branch information
alexgarel authored Dec 20, 2024
1 parent 31243c7 commit e66db34
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
12 changes: 11 additions & 1 deletion backend/editor/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,20 @@ def file_cleanup(filepath):
log.warn(f"Taxonomy file {filepath} not found for deletion")


SPLIT_WITH_SLASH = {
"food_ingredients",
"food_categories",
"beauty_categories",
"beauty_labels",
"product_categories",
"product_labels",
}


def taxonomy_path_in_repository(taxonomy_name):
"""Helper function to get the path of a taxonomy in the repository"""
path = taxonomy_name
# hacky for now until we restructure better
if path in ("food_ingredients", "food_categories"):
if path in SPLIT_WITH_SLASH:
path = path.replace("_", "/")
return f"taxonomies/{path}.txt"
4 changes: 4 additions & 0 deletions taxonomy-editor-frontend/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,8 @@ export const TAXONOMY_NAMES = [
"States",
"Test",
"Vitamins",
"Beauty Categories",
"Beauty Labels",
"Product Categories",
"Product Labels",
];

0 comments on commit e66db34

Please sign in to comment.