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:
Hayden
2021-05-06 21:08:27 -08:00
committed by GitHub
parent f4384167f6
commit 95ec13161f
41 changed files with 977 additions and 449 deletions

View File

@@ -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

View File

@@ -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