Browse Source

test if organization has the sms module before fetching mobyt status

Olivier Massot 2 năm trước cách đây
mục cha
commit
06ac221496
1 tập tin đã thay đổi với 6 bổ sung1 xóa
  1. 6 1
      pages/subscription.vue

+ 6 - 1
pages/subscription.vue

@@ -306,7 +306,12 @@ Page 'Mon abonnement'
 
   const { data: dolibarrAccount, pending: dolibarrPending } = fetch(DolibarrAccount, organizationProfile.id)
 
-  const { data: mobytStatus, pending: mobytPending } = fetch(MobytUserStatus, organizationProfile.id)
+  if (organizationProfile.hasModule('Sms')) {
+    const {data: mobytStatus, pending: mobytPending} = fetch(MobytUserStatus, organizationProfile.id)
+  } else {
+    const mobytStatus = ref(null)
+    const mobytPending = ref(false)
+  }
 
   const formatCurrency = (value: Number, currency: string): string => {
     return value.toLocaleString(i18n.locale.value, { style: 'currency', currency: currency })