From 81e9b5a966b28c823cb8ee2901f6312aa74ff26e Mon Sep 17 00:00:00 2001 From: "arun.patidar" Date: Fri, 20 Dec 2024 11:55:04 +0530 Subject: [PATCH 1/4] Updated method type as per changes in rest api. --- src/services/ProductStoreService.ts | 8 ++++---- src/views/CreateProductStore.vue | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/services/ProductStoreService.ts b/src/services/ProductStoreService.ts index 12d49bd..5db13c7 100644 --- a/src/services/ProductStoreService.ts +++ b/src/services/ProductStoreService.ts @@ -43,12 +43,12 @@ const fetchProductStoresFacilityCount = async (payload: any): Promise => { const updateProductStore = async (payload: any): Promise => { return api({ url: `productStores/${payload.productStoreId}`, - method: "post", + method: "put", data: payload }); } -const updateDBICCountries = async (payload: any): Promise => { +const addDBICCountries = async (payload: any): Promise => { return api({ url: "countries/dbic", method: "post", @@ -86,7 +86,7 @@ const updateCompany = async (payload: any): Promise => { const updateCurrentStoreSettings = async (payload: any): Promise => { return api({ url: `productStores/${payload.productStoreId}/settings`, - method: "post", + method: "put", data: payload }); } @@ -100,6 +100,6 @@ export const ProductStoreService = { fetchProductStoresFacilityCount, updateCompany, updateCurrentStoreSettings, - updateDBICCountries, + addDBICCountries, updateProductStore } \ No newline at end of file diff --git a/src/views/CreateProductStore.vue b/src/views/CreateProductStore.vue index 21e8dd1..cc9533f 100644 --- a/src/views/CreateProductStore.vue +++ b/src/views/CreateProductStore.vue @@ -118,9 +118,9 @@ async function manageConfigurations() { const productStoreId = resp.data.productStoreId; if(!dbicCountriesCount.value) { - const responses = await Promise.allSettled(selectedCountries.value.map((country: any) => ProductStoreService.updateDBICCountries({ + const responses = await Promise.allSettled(selectedCountries.value.map((country: any) => ProductStoreService.addDBICCountries({ geoId: country.geoId, - geoIdTo: "DBIC", + toGeoId: "DBIC", geoAssocTypeId: "GROUP_MEMBER" })) ) From c5fcceb261ce3a937b1e3368f29a0c091d152e14 Mon Sep 17 00:00:00 2001 From: "arun.patidar" Date: Fri, 20 Dec 2024 12:09:37 +0530 Subject: [PATCH 2/4] For productStore Setting used method type post for updating and creating store settings. --- src/services/ProductStoreService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/ProductStoreService.ts b/src/services/ProductStoreService.ts index 5db13c7..ca5d2f3 100644 --- a/src/services/ProductStoreService.ts +++ b/src/services/ProductStoreService.ts @@ -86,7 +86,7 @@ const updateCompany = async (payload: any): Promise => { const updateCurrentStoreSettings = async (payload: any): Promise => { return api({ url: `productStores/${payload.productStoreId}/settings`, - method: "put", + method: "post", data: payload }); } From 798ae38bca58b7a4ad94577ac66e4c5f1abe188c Mon Sep 17 00:00:00 2001 From: "arun.patidar" Date: Fri, 20 Dec 2024 19:03:11 +0530 Subject: [PATCH 3/4] Updated Get Countries API to get only country type Geo. also updated field name from geoIdTo to toGeoId --- src/store/modules/util/actions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/store/modules/util/actions.ts b/src/store/modules/util/actions.ts index b31c91e..1439e17 100644 --- a/src/store/modules/util/actions.ts +++ b/src/store/modules/util/actions.ts @@ -29,7 +29,7 @@ const actions: ActionTree = { let countries = [] as any; try { - const resp = await UtilService.fetchDBICCountries({ geoIdTo: "DBIC", pageSize: 200 }) + const resp = await UtilService.fetchDBICCountries({toGeoId: "DBIC", pageSize: 200 }) if(!hasError(resp)) { countries = resp.data; } else { @@ -47,7 +47,7 @@ const actions: ActionTree = { let operatingCountries = [] as any; try { - const resp = await UtilService.fetchOperatingCountries({ pageSize: 200 }) + const resp = await UtilService.fetchOperatingCountries({ pageSize: 300, geoTypeEnumId: 'GEOT_COUNTRY' }) if(!hasError(resp)) { operatingCountries = resp.data; } else { From 304485b7f2a14852d22bb61e3874f14f5357b859 Mon Sep 17 00:00:00 2001 From: "arun.patidar" Date: Mon, 23 Dec 2024 14:23:13 +0530 Subject: [PATCH 4/4] Updated EnumId as per correct existing data for productStore setting enums. --- src/views/ProductStoreDetails.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/ProductStoreDetails.vue b/src/views/ProductStoreDetails.vue index d020ff5..7b89782 100644 --- a/src/views/ProductStoreDetails.vue +++ b/src/views/ProductStoreDetails.vue @@ -312,11 +312,11 @@ - {{ translate("Delivery method") }} + {{ translate("Delivery method") }} - + {{ shipmentMethod.description ? shipmentMethod.description : shipmentMethod.shipmentMethodTypeId }}