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:
Rafael Taranto 2025-06-25 11:21:10 +01:00 committed by GitHub
commit 9125b26e88
8 changed files with 153 additions and 105 deletions

View file

@ -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() {