API add pending withdraws filter on GET /exits

This commit is contained in:
laisolizq
2020-11-03 13:44:30 +01:00
parent 1ad4f7ded5
commit 04d969c274
4 changed files with 43 additions and 3 deletions

View File

@@ -22,6 +22,12 @@ func getExits(c *gin.Context) {
retBadReq(err, c)
return
}
// OnlyPendingWithdraws
onlyPendingWithdraws, err := parseQueryBool("onlyPendingWithdraws", nil, c)
if err != nil {
retBadReq(err, c)
return
}
// Pagination
fromItem, order, limit, err := parsePagination(c)
if err != nil {
@@ -31,7 +37,7 @@ func getExits(c *gin.Context) {
// Fetch exits from historyDB
exits, pagination, err := h.GetExitsAPI(
addr, bjj, tokenID, idx, batchNum, fromItem, limit, order,
addr, bjj, tokenID, idx, batchNum, onlyPendingWithdraws, fromItem, limit, order,
)
if err != nil {
retSQLErr(err, c)