input_pill: Refactor payload object in appendValidatedData function.

Refactored `payload` object such that when we migrate this module to typescript,
we will not have to write an incomplete type definition for this object.
This commit is contained in:
Lalit
2023-04-25 15:11:35 +05:30
committed by Tim Abbott
parent e5e8c949d3
commit c0e9e463fb

View File

@@ -89,12 +89,6 @@ export function create(opts) {
return;
}
const payload = {
item,
};
store.pills.push(payload);
const has_image = item.img_src !== undefined;
const opts = {
@@ -120,7 +114,12 @@ export function create(opts) {
}
const pill_html = render_input_pill(opts);
payload.$element = $(pill_html);
const payload = {
item,
$element: $(pill_html),
};
store.pills.push(payload);
store.$input.before(payload.$element);
},