mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-10-27 08:14:30 -04:00
update foods and units for multitenant support
This commit is contained in:
21
tests/utils/routes.py
Normal file
21
tests/utils/routes.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from pydantic import UUID4
|
||||
|
||||
|
||||
class _RoutesBase:
|
||||
prefix = "/api"
|
||||
base = f"{prefix}/"
|
||||
|
||||
def __init__(self) -> None:
|
||||
raise Exception("This class is not meant to be instantiated.")
|
||||
|
||||
@classmethod
|
||||
def item(cls, item_id: int | str | UUID4) -> str:
|
||||
return f"{cls.base}/{item_id}"
|
||||
|
||||
|
||||
class RoutesFoods(_RoutesBase):
|
||||
base = "/api/foods"
|
||||
|
||||
|
||||
class RoutesUnits(_RoutesBase):
|
||||
base = "/api/units"
|
||||
Reference in New Issue
Block a user