Skip to content
This repository has been archived by the owner on May 28, 2023. It is now read-only.

Commit

Permalink
Merge pull request #343 from rain2o/update/orders-history-pagination
Browse files Browse the repository at this point in the history
Order History Pagination
  • Loading branch information
pkarw authored Sep 24, 2019
2 parents 1f9dfe2 + aab69c2 commit 2c98279
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/api/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ export default ({config, db}) => {
*/
userApi.get('/order-history', (req, res) => {
const userProxy = _getProxy(req)
userProxy.orderHistory(req.query.token).then((result) => {
userProxy.orderHistory(
req.query.token,
req.query.pageSize || 20,
req.query.currentPage || 1
).then((result) => {
apiStatus(res, result, 200);
}).catch(err => {
apiError(res, err);
Expand Down
4 changes: 2 additions & 2 deletions src/platform/magento2/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class UserProxy extends AbstractUserProxy {

return this.api.customers.me(requestToken)
}
orderHistory (requestToken) {
return this.api.customers.orderHistory(requestToken)
orderHistory (requestToken, pageSize = 20, currentPage = 1) {
return this.api.customers.orderHistory(requestToken, pageSize, currentPage)
}
resetPassword (emailData) {
return this.api.customers.resetPassword(emailData)
Expand Down

0 comments on commit 2c98279

Please sign in to comment.