fix: filter admin_api if org is present (#15386)

* fix: filter admin_api if org is present

* remove admin_api from developers tab when org is present

---------

Co-authored-by: Amit Sharma <74371312+Amit91848@users.noreply.github.com>
This commit is contained in:
Pranav Rajveer
2024-07-16 11:30:39 +02:00
committed by GitHub
co-authored by Amit Sharma
parent cada4a58ac
commit 13ec930a61
@@ -58,7 +58,6 @@ const tabs: VerticalTabItemProps[] = [
//
{ name: "webhooks", href: "/settings/developer/webhooks" },
{ name: "api_keys", href: "/settings/developer/api-keys" },
// TODO: hide this if they have an organisation
{ name: "admin_api", href: "/settings/organizations/admin-api" },
// TODO: Add profile level for embeds
// { name: "embeds", href: "/v2/settings/developer/embeds" },
@@ -186,6 +185,9 @@ const useTabs = () => {
(childTab) => childTab.href !== "/settings/security/two-factor-auth"
);
return { ...tab, children: filtered };
} else if (tab.href === "/settings/developer" && !!orgBranding) {
const filtered = tab?.children?.filter((childTab) => childTab.name !== "admin_api");
return { ...tab, children: filtered };
}
return tab;
});