fix pagination in governor notional available endpoint (#272)

This commit is contained in:
walker-16 2023-04-27 17:31:33 -03:00 committed by GitHub
parent bae5f06afb
commit 1ea141ec95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -509,6 +509,12 @@ func (r *Repository) GetAvailableNotional(
}},
}
// skip initial pages
skipStage9 := bson.D{{"$skip", q.Pagination.Skip}}
// limit size of results
limitStage10 := bson.D{{"$limit", q.Pagination.Limit}}
pipeLine := mongo.Pipeline{
matchStage1,
projectStage2,
@ -518,6 +524,8 @@ func (r *Repository) GetAvailableNotional(
projectStage6,
projectStage7,
sortStage8,
skipStage9,
limitStage10,
}
// execute aggregate operations.