Merge pull request 'fix skip' (#60) from feature/pagination into master
Reviewed-on: #60
This commit is contained in:
commit
03036b2d3b
@ -84,8 +84,7 @@ 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`.",
|
||||||
)
|
)
|
||||||
limit = limit + skip
|
skip = limit * skip
|
||||||
|
|
||||||
# Initialize filters
|
# Initialize filters
|
||||||
filters = []
|
filters = []
|
||||||
|
|
||||||
@ -166,7 +165,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`.",
|
||||||
)
|
)
|
||||||
limit = limit + skip
|
skip = limit * skip
|
||||||
|
|
||||||
# Initialize filters
|
# Initialize filters
|
||||||
filters = [{"status": {"$eq": status}}]
|
filters = [{"status": {"$eq": status}}]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user