editing updates, cosmetic changes

This commit is contained in:
2026-03-13 18:18:31 +07:00
parent 7f4f8a883d
commit a011b2724b
7 changed files with 85 additions and 8 deletions

View File

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