chore: minor fixes and formatting
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from aiogram import Router, F
|
||||
from aiogram.types import CallbackQuery, Message
|
||||
from aiogram import F, Router
|
||||
from aiogram.filters import Command
|
||||
from aiogram.fsm.context import FSMContext
|
||||
from aiogram.types import CallbackQuery, Message
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from config import PAGE_SIZE
|
||||
@@ -21,15 +21,14 @@ async def cart_init(
|
||||
):
|
||||
await state.clear()
|
||||
|
||||
cart = await order_service.build_pagination_cart_dto(
|
||||
session, customer=cb.from_user.id
|
||||
)
|
||||
cart = await order_service.build_pagination_cart_dto(session, customer=cb.from_user.id)
|
||||
if not len(cart.items):
|
||||
await cb.message.edit_text("🛒 Корзина пуста.", reply_markup=return_menu)
|
||||
return
|
||||
|
||||
await cb.message.edit_text(
|
||||
f"total: {cart.total}₽ | {len(cart.items)}",
|
||||
"<b>🌸 Убедитесь в том, что все желаемые позиции есть в заказе ниже!</b>\n\n"
|
||||
f"<b>Сумма:</b> <i>{cart.total}₽</i>",
|
||||
reply_markup=render_cart(
|
||||
cart.items[:PAGE_SIZE],
|
||||
show_next=len(cart.items) > PAGE_SIZE,
|
||||
@@ -47,9 +46,7 @@ async def cart_cmd(
|
||||
):
|
||||
await state.clear()
|
||||
|
||||
cart = await order_service.build_pagination_cart_dto(
|
||||
session, customer=msg.from_user.id
|
||||
)
|
||||
cart = await order_service.build_pagination_cart_dto(session, customer=msg.from_user.id)
|
||||
|
||||
if not len(cart.items):
|
||||
await msg.answer("🛒 Корзина пуста.", reply_markup=return_menu)
|
||||
|
||||
Reference in New Issue
Block a user