Fixed route for new icon structure
This commit is contained in:
parent
9f315160f6
commit
90b366bd7a
1 changed files with 3 additions and 3 deletions
|
|
@ -64,9 +64,9 @@ def get_all_products():
|
||||||
def get_single_product(barcode: int):
|
def get_single_product(barcode: int):
|
||||||
return data_connection.get_single_product(barcode)
|
return data_connection.get_single_product(barcode)
|
||||||
|
|
||||||
@app.get("/icons/{icon_filename}", response_class=FileResponse)
|
@app.get("/icons/{icon_category}/{icon_filename}", response_class=FileResponse)
|
||||||
def get_icon(icon_filename: str):
|
def get_icon(icon_category: str, icon_filename: str):
|
||||||
full_filepath = os.path.join(definitions.ICONS_PATH, icon_filename) + ".svg"
|
full_filepath = os.path.join(definitions.ICONS_PATH, icon_category, icon_filename) + ".svg"
|
||||||
assert os.path.exists(full_filepath), f"File {full_filepath} not found"
|
assert os.path.exists(full_filepath), f"File {full_filepath} not found"
|
||||||
assert image_validator.is_valid_svg(file_name=full_filepath), f"File {full_filepath} is not a valid image"
|
assert image_validator.is_valid_svg(file_name=full_filepath), f"File {full_filepath} is not a valid image"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue