mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
12085: fix customer search autofill issue
This commit is contained in:
@@ -9,7 +9,7 @@ export const useSearchCustomer = (controller) => {
|
||||
fetch("/admin/search/customers.json?" + new URLSearchParams(params))
|
||||
.then((response) => response.json())
|
||||
.then((json) => {
|
||||
this.items = json;
|
||||
this.items = [...this.items, ...json];
|
||||
callback(json);
|
||||
})
|
||||
.catch((error) => {
|
||||
|
||||
@@ -6,6 +6,7 @@ export default class extends TomSelectController {
|
||||
static values = { options: Object, distributor: Number };
|
||||
|
||||
connect() {
|
||||
this.items = [];
|
||||
useSearchCustomer(this);
|
||||
useRenderCustomer(this);
|
||||
const options = {
|
||||
@@ -20,7 +21,6 @@ export default class extends TomSelectController {
|
||||
};
|
||||
super.connect(options);
|
||||
this.control.on("item_add", this.onItemSelect.bind(this));
|
||||
this.items = [];
|
||||
}
|
||||
|
||||
onItemSelect(id, item) {
|
||||
|
||||
Reference in New Issue
Block a user