initial launch market

This commit is contained in:
Tiago vasconcelos
2022-07-27 15:28:58 +01:00
parent 0f238286a3
commit 6d5e9aba39
6 changed files with 127 additions and 11 deletions
+18
View File
@@ -38,3 +38,21 @@ async def display(request: Request, stall_id):
"products": [product.dict() for product in products]
},
)
@diagonalley_ext.get("/{market_id}", response_class=HTMLResponse)
async def display(request: Request, stall_id):
stalls = await get_diagonalley_stall(stall_id)
products = await get_diagonalley_products(stall_id)
if not stall:
raise HTTPException(
status_code=HTTPStatus.NOT_FOUND, detail="Stall does not exist."
)
return diagonalley_renderer().TemplateResponse(
"diagonalley/stall.html",
{
"request": request,
"stall": stall.dict(),
"products": [product.dict() for product in products]
},
)