mirror of
https://github.com/hay-kot/mealie.git
synced 2025-07-16 10:03:54 -07:00
update foods and units for multitenant support
This commit is contained in:
parent
fbc17b670d
commit
9a82a172cb
11 changed files with 194 additions and 15 deletions
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"
|
Loading…
Add table
Add a link
Reference in a new issue