diff --git a/resources/js/Layouts/GuestLayout.vue b/resources/js/Layouts/GuestLayout.vue index 4598b7d..9e921cf 100644 --- a/resources/js/Layouts/GuestLayout.vue +++ b/resources/js/Layouts/GuestLayout.vue @@ -32,8 +32,18 @@ const countryCurrency = ref([]) const currencyHash = ref([]) const ccountry = ref([]) -const ccountry_list = ref([]) -const items = ref([]) + +const ccountry_list = computed(() => { + let computed_list = settingsStore.ccountry_list.filter((c) => (c.online == (settingsStore.online ? 'Y' : 'N')) || 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); + console.log('COMPUTED_LIST',computed_list); + return computed_list; +}) let tsettings = computed(() => { let country = "GB"; @@ -127,21 +137,15 @@ const fetch = async () => { let aCntry = ccountry.value.map((country) => [country.country_name]); settingsStore.ccountry_filter.push(...aCntry); - ccountry_list.value = ccountry.value.map((country) => { + console.log('CCOUNTRY=',ccountry); + settingsStore.ccountry_list = ccountry.value.map((country) => { return { name: country.country_name, code: country.country_code, + status: country.status, + online: country.only_online, }; }); - var i = 1; - items.value = ccountry.value.map((country) => { - return { - country: country.country_name, - currency: country.currency_code, - id: i++, - }; - }); - console.log("TEST=", settingsStore.ccountry_filter, ccountry_list.value); } catch (e) { const response = await Swal.fire({ @@ -242,9 +246,9 @@ onMounted(fetch_menu); Country in which search product