Skip to content

Commit

Permalink
Merge pull request #18 from tapglue/user-search-pagination
Browse files Browse the repository at this point in the history
Add pagination to user search endpoints
  • Loading branch information
xla authored Nov 22, 2016
2 parents cdaab8e + 028bc1b commit 954c923
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions handler/http/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,12 @@ func UserSearchEmails(fn core.UserListByEmailsFunc) Handler {
}

respondJSON(w, http.StatusOK, &payloadUsers{
pagination: pagination(
r,
opts.Limit,
userCursorAfter(us, opts.Limit),
userCursorBefore(us, opts.Limit),
),
users: us,
})
}
Expand Down Expand Up @@ -341,6 +347,12 @@ func UserSearchPlatform(fn core.UserListByPlatformIDsFunc) Handler {
}

respondJSON(w, http.StatusOK, &payloadUsers{
pagination: pagination(
r,
opts.Limit,
userCursorAfter(us, opts.Limit),
userCursorBefore(us, opts.Limit),
),
users: us,
})
}
Expand Down

0 comments on commit 954c923

Please sign in to comment.