Online search

This commit is contained in:
2024-03-22 11:02:04 +01:00
parent 5aa4055be3
commit 6123a5532a
3 changed files with 7 additions and 13 deletions

View File

@@ -10,7 +10,7 @@ use Illuminate\Support\Facades\Log;
class IkeaProductsController extends Controller
{
public function search(Request $request, string $field, string $text, ?string $country = '', $online = false)
public function search(Request $request, string $field, string $text, ?string $country = '')
{
return IkeaProducts::search($field, $text, $country);
}

View File

@@ -215,11 +215,6 @@ const sleep = (ms) => {
return new Promise((resolve) => setTimeout(resolve, ms));
};
const onSelectCode = () => {
if (settingsStore.field.value == 'code') {
}
}
const fetch = async () => {
try {
const response = await axios.get(route("ccountry.active"));
@@ -317,7 +312,7 @@ const async_search = async () => {
console.log('SETTINGS',settingsStore.country);
console.log('URL',route("products.search", ['all', settingsStore.text, country]));
const response = await axios.get(route("products.search", ['all', settingsStore.text, country, settingsStore.online]));
const response = await axios.get(route("products.search", ['all', settingsStore.text, country]));
options_items.value = response.data.map((i) => {
return {
@@ -333,9 +328,7 @@ const async_search = async () => {
};
});
console.log("VALUES=", options_items.value);
if (settingsStore.field.value == 'code') {
showRow({'code': settingsStore.text});
}
productsCriteria.value = null;
} catch (e) {
const response = await Swal.fire({
@@ -472,7 +465,7 @@ const selectedRowClassNameFunction = (item) => {
}}</a>
</template>
</EasyTable>
<div v-if="settingsStore.field == 'code' && settingsStore.online == true">Online</div>
<div v-if="settingsStore.online == true">Online</div>
<div v-else-if="'LAST_REFRESH_TIME' in settingsStore.settings">Last Refresh Time: {{ settingsStore.settings["LAST_REFRESH_TIME"] }}</div>
</div>
</div>
@@ -493,10 +486,10 @@ const selectedRowClassNameFunction = (item) => {
</div>
</div>
<div class="ml-2" >
<div v-if="settingsStore.field == 'code'">
<div>
<span class="font-extrabold font-mono">Online:</span>
</div>
<div v-if="settingsStore.field == 'code'">
<div>
<input
type="checkbox"
class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"

View File

@@ -5,6 +5,7 @@ export const settingsStore = reactive({
countries: "",
country: "",
field: "",
online: false,
text: "",
currency: "EUR",
online: false,