diff --git a/routers/card.py b/routers/card.py index c9b0074..b0b2d4a 100644 --- a/routers/card.py +++ b/routers/card.py @@ -94,7 +94,7 @@ async def get_summary( @card_router.post( '/summaries/reorder', - response_model=CardSummaryResponse, + response_model=ReorderResponse, operation_id='reorderCardSummaries', dependencies=[Depends(authorized_user)] ) diff --git a/schemas/card.py b/schemas/card.py index f69fe7a..351834e 100644 --- a/schemas/card.py +++ b/schemas/card.py @@ -360,6 +360,10 @@ class CardSummaryResponse(BaseSchema): pagination_info: PaginationInfoSchema +class ReorderResponse(OkMessageSchema): + pass + + class CardAddServicesResponse(BaseSchema): ok: bool message: str diff --git a/services/card.py b/services/card.py index 689e795..91eb573 100644 --- a/services/card.py +++ b/services/card.py @@ -491,7 +491,7 @@ class CardsService(BaseService): await self.session.commit() return UpdateCardClientResponse(ok=True, message='Данные карточки успешно обновлены') - async def reorder(self, request: CardSummaryReorderRequest, user: User) -> CardSummaryResponse: + async def reorder(self, request: CardSummaryReorderRequest, user: User) -> ReorderResponse: card: Card = await self.session.scalar(select(Card).where(Card.id == request.card_id)) if request.index == 1: request.index = 0 @@ -535,7 +535,7 @@ class CardsService(BaseService): comment=request.comment, rank=str(new_rank)) await self.session.commit() - return await self.get_summary() + return ReorderResponse(ok=True, message="Изменения сохранены") async def add_kit_to_card(self, request: CardAddKitRequest) -> CardAddKitResponse: try: