mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-02-11 02:13:12 -05:00
feature/profile-cards (#391)
* unify format * pass variables * remove namespace * rename * group-card init * shuffle + icons * remove console.logs * token CRUD * update changelog * add profile link * consolidate mealplan to profile dashboard * update docs * add query parameter to search page * update test routes * update python depts * basic token tests Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from typing import Optional
|
||||
|
||||
from fastapi_camelcase import CamelModel
|
||||
from mealie.schema.category import CategoryBase
|
||||
from mealie.schema.category import CategoryBase, RecipeCategoryResponse
|
||||
from pydantic import validator
|
||||
from slugify import slugify
|
||||
|
||||
@@ -34,7 +34,7 @@ class CustomPageBase(CamelModel):
|
||||
name: str
|
||||
slug: Optional[str]
|
||||
position: int
|
||||
categories: list[CategoryBase] = []
|
||||
categories: list[RecipeCategoryResponse] = []
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
|
||||
@@ -10,6 +10,25 @@ from pydantic.types import constr
|
||||
from pydantic.utils import GetterDict
|
||||
|
||||
|
||||
class LoingLiveTokenIn(CamelModel):
|
||||
name: str
|
||||
|
||||
|
||||
class LongLiveTokenOut(LoingLiveTokenIn):
|
||||
id: int
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
|
||||
|
||||
class CreateToken(LoingLiveTokenIn):
|
||||
parent_id: int
|
||||
token: str
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
|
||||
|
||||
class ChangePassword(CamelModel):
|
||||
current_password: str
|
||||
new_password: str
|
||||
@@ -53,6 +72,7 @@ class UserIn(UserBase):
|
||||
class UserOut(UserBase):
|
||||
id: int
|
||||
group: str
|
||||
tokens: Optional[list[LongLiveTokenOut]]
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
@@ -96,3 +116,11 @@ class GroupInDB(UpdateGroup):
|
||||
**GetterDict(orm_model),
|
||||
"webhook_urls": [x.url for x in orm_model.webhook_urls if x],
|
||||
}
|
||||
|
||||
|
||||
class LongLiveTokenInDB(CreateToken):
|
||||
id: int
|
||||
user: UserInDB
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
|
||||
Reference in New Issue
Block a user