Minor tweaks to sign up on frontend and database structure
This commit is contained in:
1 parent
d0690f2f06
commit
260bef98cd
10 files changed
+56
-1037
No files matched your search
@@ -1,18 +1,26 @@
|
||||
from typing import Optional
|
||||
|
||||
from fastapi import APIRouter
|
||||
|
||||
from app.api.dependencies import CurrentOwnerUser, SessionDep
|
||||
from app.crud.shop_crud import create_shop
|
||||
from app.schemas.shop_schemas import ShopCreate
|
||||
from app.schemas.user_schemas import Token
|
||||
from app.schemas.shop_schemas import ShopCreate, ShopPublic
|
||||
|
||||
router = APIRouter(prefix="/shop", tags=["Dashboard"])
|
||||
|
||||
|
||||
@router.post("", status_code=201)
|
||||
def register_new_shop(
|
||||
async def register_new_shop(
|
||||
session: SessionDep,
|
||||
current_user: CurrentOwnerUser,
|
||||
shop_data: ShopCreate
|
||||
) -> bool:
|
||||
create_shop(session, shop_data, current_user)
|
||||
return True
|
||||
|
||||
|
||||
@router.get("")
|
||||
async def get_owned_shop_info(
|
||||
current_user: CurrentOwnerUser
|
||||
) -> Optional[ShopPublic]:
|
||||
return current_user.owned_shop
|
||||
Reference in new issue
Block a user