mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 18:28:12 +00:00
Merge pull request #272 from Neeraj138/subscription-check
Add check for subscriptions call before setting the current plan
This commit is contained in:
@@ -34,7 +34,9 @@ const EnvironmentTable = ({ data = [], onCreateEnv, onDeleteEnv, onUpdateEnv }:
|
|||||||
const subscriptions = await getOrganizationSubscriptions({
|
const subscriptions = await getOrganizationSubscriptions({
|
||||||
orgId
|
orgId
|
||||||
});
|
});
|
||||||
setPlan(subscriptions.data[0].plan.product);
|
if (subscriptions) {
|
||||||
|
setPlan(subscriptions.data[0].plan.product)
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, []);
|
}, []);
|
||||||
|
|||||||
@@ -66,8 +66,9 @@ export default function SettingsBilling() {
|
|||||||
const subscriptions = await getOrganizationSubscriptions({
|
const subscriptions = await getOrganizationSubscriptions({
|
||||||
orgId
|
orgId
|
||||||
});
|
});
|
||||||
|
if (subscriptions) {
|
||||||
setCurrentPlan(subscriptions.data[0].plan.product);
|
setCurrentPlan(subscriptions.data[0].plan.product);
|
||||||
|
}
|
||||||
const orgUsers = await getOrganizationUsers({
|
const orgUsers = await getOrganizationUsers({
|
||||||
orgId
|
orgId
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -87,7 +87,9 @@ export default function SettingsOrg() {
|
|||||||
const subscriptions = await getOrganizationSubscriptions({
|
const subscriptions = await getOrganizationSubscriptions({
|
||||||
orgId
|
orgId
|
||||||
});
|
});
|
||||||
setCurrentPlan(subscriptions.data[0].plan.product);
|
if (subscriptions) {
|
||||||
|
setCurrentPlan(subscriptions.data[0].plan.product);
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user