editing updates, cosmetic changes
This commit is contained in:
@@ -3,9 +3,9 @@ from aiogram.types import CallbackQuery, Message
|
||||
from aiogram.fsm.context import FSMContext
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from dto.catalogue import NewCategoryContext
|
||||
from dto.catalogue import CategoryActionContext
|
||||
from misc.filters import IsVerified
|
||||
from misc.kb.client import get_back_to_catalogue
|
||||
from misc.kb.client import created_category, get_back_to_catalogue
|
||||
from misc.mapper import parse_cat_id
|
||||
from misc.states import AdminControlStorage
|
||||
from misc.kb.common import return_menu
|
||||
@@ -36,7 +36,7 @@ async def creation_init(
|
||||
reply_markup=get_back_to_catalogue(cat_id),
|
||||
)
|
||||
|
||||
ctx = NewCategoryContext(cb.message, cat_id)
|
||||
ctx = CategoryActionContext(cb.message, cat_id)
|
||||
await state.set_state(AdminControlStorage.new_category)
|
||||
await state.set_data({"ctx": ctx})
|
||||
|
||||
@@ -54,7 +54,7 @@ async def create_new_category(
|
||||
await msg.delete()
|
||||
|
||||
data = await state.get_data()
|
||||
ctx: NewCategoryContext | None = data.get("ctx")
|
||||
ctx: CategoryActionContext | None = data.get("ctx")
|
||||
|
||||
if not ctx:
|
||||
await msg.reply("❌ Ошибка при создании категории.", reply_markup=return_menu)
|
||||
@@ -66,5 +66,7 @@ async def create_new_category(
|
||||
|
||||
await ctx.msg.edit_text(
|
||||
f"✅ Категория {msg.text} создана успешно.",
|
||||
reply_markup=get_back_to_catalogue(category.id, text="🛒 Перейти"),
|
||||
reply_markup=created_category(
|
||||
category.id, f"🛒 {category.name}", category.parent_id
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user