From fcf0ef36abf88c1dbeb5affc150d995f53046046 Mon Sep 17 00:00:00 2001 From: Jaroslav Drzik Date: Sun, 24 Mar 2024 18:09:35 +0100 Subject: [PATCH] database structure fix --- resources/js/Layouts/GuestLayout.vue | 12 ++++++------ resources/js/Pages/IkeaRoot.vue | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/resources/js/Layouts/GuestLayout.vue b/resources/js/Layouts/GuestLayout.vue index 9e921cf..f7866d4 100644 --- a/resources/js/Layouts/GuestLayout.vue +++ b/resources/js/Layouts/GuestLayout.vue @@ -34,13 +34,13 @@ const currencyHash = ref([]) const ccountry = ref([]) const ccountry_list = computed(() => { - let computed_list = settingsStore.ccountry_list.filter((c) => (c.online == (settingsStore.online ? 'Y' : 'N')) || settingsStore.online == true); + let computed_list = settingsStore.ccountry_list.filter((c) => (c.offline == (settingsStore.online ? 'N' : 'Y')) || settingsStore.online == true); console.log('COMPUTED_LIST',computed_list); return computed_list; }) const scountry_list = computed(() => { - let computed_list = settingsStore.ccountry_list.filter((c) => (c.online == (settingsStore.online ? 'Y' : 'N')) || settingsStore.online == true); + let computed_list = settingsStore.ccountry_list.filter((c) => (c.offline == (settingsStore.online ? 'N' : 'Y')) || settingsStore.online == true); console.log('COMPUTED_LIST',computed_list); return computed_list; }) @@ -143,7 +143,7 @@ const fetch = async () => { name: country.country_name, code: country.country_code, status: country.status, - online: country.only_online, + offline: country.only_offline, }; }); @@ -188,13 +188,13 @@ watch(ccodes, (codes) => { console.log("IP=", geoip.value); let fonud = false; - codes.forEach((c) => { + scountry_list.value.forEach((c) => { if (c.code == geoip.value.iso_code) { settingsStore.country = c; found = true; } }); - if (fonud == false) settingsStore.country = codes.filter((c) => {return c.code == 'GB'})[0]; + if (fonud == false) settingsStore.country = scountry_list.value.filter((c) => {return c.code == 'GB'})[0]; console.log("FC=", settingsStore.country); }); @@ -246,7 +246,7 @@ onMounted(fetch_menu); Country in which search product
- + diff --git a/resources/js/Pages/IkeaRoot.vue b/resources/js/Pages/IkeaRoot.vue index 3de32bf..4df68ba 100644 --- a/resources/js/Pages/IkeaRoot.vue +++ b/resources/js/Pages/IkeaRoot.vue @@ -87,7 +87,7 @@ const chart_coutries = computed(() => { let countries = [["Country"]]; for (let i=0; i < settingsStore.ccountry_list.length ; i++) { - if (settingsStore.ccountry_list[i].online == (settingsStore.online ? 'Y' : 'N') || settingsStore.online == true) + if (settingsStore.ccountry_list[i].offline == (settingsStore.online ? 'N' : 'Y') || settingsStore.online == true) countries.push([settingsStore.ccountry_list[i].name]); } return countries;