Skip to content

Commit

Permalink
Merge pull request #1709 from RafaelTaranto/fix/customer-list
Browse files Browse the repository at this point in the history
LAM-1140 fix: customer list ordering with limit
  • Loading branch information
RafaelTaranto authored Aug 16, 2024
2 parents f290bde + 876c0e3 commit 9444bf9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/customers.js
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ function getCustomersList (phone = null, name = null, address = null, id = null,
AND ($6 IS NULL OR id_card_data::json->>'address' = $6)
AND ($7 IS NULL OR id_card_data::json->>'documentNumber' = $7)
AND ($8 IS NULL OR email = $8)
ORDER BY last_active DESC
limit $3`
return db.any(sql, [ passableErrorCodes, anonymous.uuid, NUM_RESULTS, phone, name, address, id, email ])
.then(customers => Promise.all(_.map(customer =>
Expand Down

0 comments on commit 9444bf9

Please sign in to comment.