mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 19:16:22 +00:00
24 lines
659 B
TypeScript
24 lines
659 B
TypeScript
import SecurityClient from "@app/components/utilities/SecurityClient";
|
|
|
|
/**
|
|
* This route lets us get the current subscription of an org.
|
|
* @param {*} req
|
|
* @param {*} res
|
|
* @returns
|
|
*/
|
|
const getOrganizationSubscriptions = (req: { orgId: string }) =>
|
|
SecurityClient.fetchCall(`/api/v1/organization/${req.orgId}/subscriptions`, {
|
|
method: "GET",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
}
|
|
}).then(async (res) => {
|
|
if (res && res.status === 200) {
|
|
return (await res.json()).subscriptions;
|
|
}
|
|
console.log("Failed to get org subscriptions");
|
|
return undefined;
|
|
});
|
|
|
|
export default getOrganizationSubscriptions;
|