From 6565e4ae446cdb1c88ab510411abc763152eb61e Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Thu, 30 May 2024 15:42:29 +0530 Subject: [PATCH 1/6] Improved: added support to redirect user to facilities list page with product store filter (#7) --- src/views/ProductStore.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/views/ProductStore.vue b/src/views/ProductStore.vue index 25bc92e..241e040 100644 --- a/src/views/ProductStore.vue +++ b/src/views/ProductStore.vue @@ -17,7 +17,7 @@ -
+
{{ translate("facilities", { count: store.facilityCount }) }} @@ -49,11 +49,14 @@ import { translate } from "@/i18n"; import { useRouter } from "vue-router"; import { computed } from "vue"; import { useStore } from "vuex"; +import { useAuthStore } from '@hotwax/dxp-components' const store = useStore(); const router = useRouter(); +const authStore = useAuthStore(); const productStores = computed(() => store.getters["productStore/getProductStores"]) +const omsRedirectionInfo = computed(() => store.getters["user/getOmsRedirectionInfo"]) onIonViewWillEnter(async () => { await store.dispatch("productStore/fetchProductStores"); @@ -66,6 +69,11 @@ async function viewProductStoreDetails(productStoreId: string) { function createStore() { router.push("/create-product-store") } + +function viewFacilities(productStoreId: string) { + const facilitiesListUrl = `${process.env.VUE_APP_FACILITIES_LOGIN_URL}?oms=${omsRedirectionInfo.value.url}&token=${authStore.token.value}&expirationTime=${authStore.token.expiration}&productStoreId=${productStoreId}` + window.location.href = facilitiesListUrl +}