Compare commits

..

No commits in common. "master" and "feature/persist-token" have entirely different histories.

View File

@ -84,7 +84,8 @@ async def read_events(
status_code=status.HTTP_400_BAD_REQUEST, status_code=status.HTTP_400_BAD_REQUEST,
detail="`skip` should be >= 0 and `limit` should be > 0 and greater than `skip`.", detail="`skip` should be >= 0 and `limit` should be > 0 and greater than `skip`.",
) )
skip = limit * skip limit = limit + skip
# Initialize filters # Initialize filters
filters = [] filters = []
@ -126,7 +127,7 @@ async def read_events(
# Fetch and return results # Fetch and return results
event_repository = events.EventRepository(database=database.database) event_repository = events.EventRepository(database=database.database)
list_events = [] list_events = []
for event_index in event_repository.find_by(object_search, limit=limit, skip=skip, sort=[("start_date", 1)]): for event_index in event_repository.find_by(object_search, limit=limit, skip=skip):
event = events.EventOut( event = events.EventOut(
id=event_index.id, id=event_index.id,
tags=event_index.tags, tags=event_index.tags,
@ -165,7 +166,7 @@ async def search_events(
status_code=status.HTTP_400_BAD_REQUEST, status_code=status.HTTP_400_BAD_REQUEST,
detail="`skip` should be >= 0 and `limit` should be > 0 and greater than `skip`.", detail="`skip` should be >= 0 and `limit` should be > 0 and greater than `skip`.",
) )
skip = limit * skip limit = limit + skip
# Initialize filters # Initialize filters
filters = [{"status": {"$eq": status}}] filters = [{"status": {"$eq": status}}]
@ -200,7 +201,7 @@ async def search_events(
# Fetch and return results # Fetch and return results
event_repository = events.EventRepository(database=database.database) event_repository = events.EventRepository(database=database.database)
list_events = [] list_events = []
for event_index in event_repository.find_by(object_search, limit=limit, skip=skip, sort=[("start_date", 1)]): for event_index in event_repository.find_by(object_search, limit=limit, skip=skip):
event = events.EventOut( event = events.EventOut(
id=event_index.id, id=event_index.id,
tags=event_index.tags, tags=event_index.tags,