Search in products with country
Some checks are pending
deploy / deploy (push) Waiting to run

This commit is contained in:
2024-01-03 21:28:11 +01:00
parent fbcc3226fe
commit cf8844471b

View File

@@ -87,7 +87,9 @@ const gchartEvents = ref({
}
},);
const sleep = (ms) => {
return new Promise(resolve => setTimeout(resolve, ms))
}
const fetch = async () => {
try {
@@ -155,8 +157,10 @@ const fetch_ccodes = async () => {
const async_search = async (item) => {
try {
if (item.length >= 2) {
console.log('SEARCH', item, form.country.code, route('products.search', [item, form.country.code]));
const response = await axios.get(route('products.search', [item, form.country.code]));
options_items.value = response.data.map((i) => { return { "item": i.name, "desc": i.typeName, "img": i.mainImageUrl, "code": i.code } });
console.log("VALUES=", options_items.value);
}
@@ -233,7 +237,8 @@ const submit = () => {
<span class="font-extrabold font-mono">Krajina produktu na vyhladanie</span>
</div>
<div>
<multiselect :close-on-select="false" :multiple="false" v-model="form.country" :options="ccodes" label="country" track-by="code">
<multiselect :close-on-select="false" :multiple="false" v-model="form.country" :options="ccodes"
label="country" track-by="code">
</multiselect>
</div>
<div>
@@ -241,7 +246,8 @@ const submit = () => {
</div>
<div>
<multiselect v-model="form.codes" label="item" track-by="item" :custom-label="customLabel"
placeholder="Find item" :searchable="true" :options="options_items" @search-change="async_search" />
:internal-search="false" placeholder="Find item" :searchable="true" :options="options_items"
@search-change="async_search" />
</div>
<div>
<span class="font-extrabold font-mono">Prepocet do meny</span>