+
{{ shopifyFacilityMapping.myshopifyDomain }}
diff --git a/src/views/FindFacilities.vue b/src/views/FindFacilities.vue
index 4705b445..d8caf059 100644
--- a/src/views/FindFacilities.vue
+++ b/src/views/FindFacilities.vue
@@ -55,7 +55,7 @@
-
+
{{ translate('Sell Online') }}
@@ -157,6 +157,7 @@ import { FacilityService } from '@/services/FacilityService'
import { showToast } from '@/utils';
import logger from '@/logger';
import Filters from '@/components/Filters.vue'
+import { DateTime } from 'luxon';
export default defineComponent({
name: 'FindFacilities',
@@ -260,7 +261,36 @@ export default defineComponent({
showToast(translate('Failed to update fulfillment capacity for ', { facilityName: facility.facilityName }))
logger.error('Failed to update facility', err)
}
- }
+ },
+ async updateSellOnlineStatus(facility: any) {
+ try {
+ let resp
+ if (!facility.sellOnline) {
+ resp = await FacilityService.addFacilityToGroup({
+ "facilityId": facility.facilityId,
+ "facilityGroupId": 'FAC_GRP'
+ })
+ } else {
+ const groupInformation = facility.groupInformation.find((group: any) => group.facilityGroupId === 'FAC_GRP')
+ resp = await FacilityService.updateFacilityToGroup({
+ "facilityId": facility.facilityId,
+ "facilityGroupId": 'FAC_GRP',
+ "fromDate": groupInformation.fromDate,
+ "thruDate": DateTime.now().toMillis()
+ })
+ }
+
+ if (!hasError(resp)) {
+ showToast(translate('Fulfillment setting updated successfully'))
+ await this.fetchFacilities();
+ } else {
+ throw resp.data
+ }
+ } catch (error) {
+ showToast(translate('Failed to update fulfillment setting'))
+ logger.error('Failed to update fulfillment setting', error)
+ }
+ },
},
setup() {
const router = useRouter();