Procházet zdrojové kódy

test if organization has the sms module before fetching mobyt status

Olivier Massot před 2 roky
rodič
revize
06ac221496
1 změnil soubory, kde provedl 6 přidání a 1 odebrání
  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 })