fix: page schems, name
This commit is contained in:
		@@ -56,10 +56,11 @@ async def get_listevents_page_by_creator_id(connection: AsyncConnection, creator
 | 
			
		||||
    # Здесь предполагается, что all_list_event_adapter.validate_python корректно обрабатывает данные
 | 
			
		||||
    validated_list_event = all_list_event_adapter.validate_python(events_data)
 | 
			
		||||
 | 
			
		||||
    return AllListEventResponse(list_event=validated_list_event, amount_count=total_count, amount_pages=total_pages)
 | 
			
		||||
    return AllListEventResponse(list_event=validated_list_event, amount_count=total_count, amount_pages=total_pages, current_page=page,
 | 
			
		||||
    limit = limit)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
async def get_listevents_page(connection: AsyncConnection, page, limit) -> Optional[ListEvent]:
 | 
			
		||||
async def get_listevents_page(connection: AsyncConnection, page, limit) -> Optional[AllListEventResponse]:
 | 
			
		||||
    """
 | 
			
		||||
    Получает список ползовелей заданных значениями  page, limit.
 | 
			
		||||
    """
 | 
			
		||||
@@ -94,7 +95,8 @@ async def get_listevents_page(connection: AsyncConnection, page, limit) -> Optio
 | 
			
		||||
    # Здесь предполагается, что all_list_event_adapter.validate_python корректно обрабатывает данные
 | 
			
		||||
    validated_list_event = all_list_event_adapter.validate_python(events_data)
 | 
			
		||||
 | 
			
		||||
    return AllListEventResponse(list_event=validated_list_event, amount_count=total_count, amount_pages=total_pages)
 | 
			
		||||
    return AllListEventResponse(list_event=validated_list_event, amount_count=total_count, amount_pages=total_pages,current_page=page,
 | 
			
		||||
    limit = limit)
 | 
			
		||||
 | 
			
		||||
async def get_listevents_by_name(connection: AsyncConnection, name: str) -> Optional[ListEvent]:
 | 
			
		||||
    """
 | 
			
		||||
@@ -142,7 +144,7 @@ async def get_listevents_by_id(connection: AsyncConnection, id: int) -> Optional
 | 
			
		||||
 | 
			
		||||
    return ListEvent.model_validate(listevents_data)
 | 
			
		||||
 | 
			
		||||
async def update_listevents_by_id(connection: AsyncConnection, update_values, listevents) -> Optional[ListEvent]:
 | 
			
		||||
async def update_listevents_by_id(connection: AsyncConnection, update_values, listevents):
 | 
			
		||||
    """
 | 
			
		||||
    Вносит изменеия в нужное поле таблицы account_table.
 | 
			
		||||
    """
 | 
			
		||||
 
 | 
			
		||||
@@ -108,8 +108,8 @@ async def create_list_events(
 | 
			
		||||
 | 
			
		||||
    if listevents_validation is None:
 | 
			
		||||
        await create_listevents(connection, listevents, user_validation.id)
 | 
			
		||||
        user_new = await get_listevents_by_name(connection, listevents.name)
 | 
			
		||||
        return user_new
 | 
			
		||||
        listevents_new = await get_listevents_by_name(connection, listevents.name)
 | 
			
		||||
        return listevents_new
 | 
			
		||||
 | 
			
		||||
    else:
 | 
			
		||||
        raise HTTPException(
 | 
			
		||||
 
 | 
			
		||||
@@ -32,6 +32,7 @@ class AllListEventResponse(Base):
 | 
			
		||||
    list_event: List[AllListEvent]
 | 
			
		||||
    amount_count: int
 | 
			
		||||
    amount_pages: int
 | 
			
		||||
 | 
			
		||||
    current_page: int
 | 
			
		||||
    limit: int
 | 
			
		||||
 | 
			
		||||
all_list_event_adapter = TypeAdapter(List[AllListEvent])
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user