Merge pull request #1890 from RafaelTaranto/feat/async-autocomplete-on-loyalty-page
LAM-1453 feat: async autocomplete on loyalty page
This commit is contained in:
commit
9125b26e88
8 changed files with 153 additions and 105 deletions
|
|
@ -488,7 +488,10 @@ function getSlimCustomerByIdBatch(ids) {
|
|||
const sql = `SELECT id, phone, id_card_data
|
||||
FROM customers
|
||||
WHERE id = ANY($1::uuid[])`
|
||||
return db.any(sql, [ids]).then(customers => _.map(camelize, customers))
|
||||
return db.any(sql, [ids]).then(customers => {
|
||||
const customersById = _.keyBy('id', _.map(camelize, customers))
|
||||
return ids.map(id => customersById[id] || null)
|
||||
})
|
||||
}
|
||||
|
||||
function getCustomersList() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue