From 6123a5532acc5e8b56b9527c8c4509855a9b1da8 Mon Sep 17 00:00:00 2001 From: Jaroslav Drzik Date: Fri, 22 Mar 2024 11:02:04 +0100 Subject: [PATCH] Online search --- app/Http/Controllers/IkeaProductsController.php | 2 +- resources/js/Pages/IkeaRoot.vue | 17 +++++------------ resources/js/settingsStore.js | 1 + 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/app/Http/Controllers/IkeaProductsController.php b/app/Http/Controllers/IkeaProductsController.php index 78e46b2..7345954 100644 --- a/app/Http/Controllers/IkeaProductsController.php +++ b/app/Http/Controllers/IkeaProductsController.php @@ -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); } diff --git a/resources/js/Pages/IkeaRoot.vue b/resources/js/Pages/IkeaRoot.vue index 891eed5..9821d55 100644 --- a/resources/js/Pages/IkeaRoot.vue +++ b/resources/js/Pages/IkeaRoot.vue @@ -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) => { }} -
Online
+
Online
Last Refresh Time: {{ settingsStore.settings["LAST_REFRESH_TIME"] }}
@@ -493,10 +486,10 @@ const selectedRowClassNameFunction = (item) => {
-
+
Online:
-
+