Add check for subscriptions call before setting the current plan

This commit is contained in:
Neeraj138
2023-01-29 14:16:05 +05:30
parent bc955a9afd
commit 3c05a4cebd
3 changed files with 9 additions and 4 deletions
@@ -34,7 +34,9 @@ const EnvironmentTable = ({ data = [], onCreateEnv, onDeleteEnv, onUpdateEnv }:
const subscriptions = await getOrganizationSubscriptions({
orgId
});
setPlan(subscriptions.data[0].plan.product);
if (subscriptions) {
setPlan(subscriptions.data[0].plan.product)
}
})();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);