ServiceAccounts: Fix org role picker update issue (#48958)

* ServiceAccounts: Fix org role picker update issue

* Do not use React.FC
This commit is contained in:
Alexander Zobnin
2022-05-16 10:05:37 +02:00
committed by GitHub
parent d73bd617f0
commit 483319f1cb
@@ -62,7 +62,7 @@ const ServiceAccountsListPage = ({
query,
filters,
serviceAccountToRemove,
}: Props) => {
}: Props): JSX.Element => {
const styles = useStyles2(getStyles);
useEffect(() => {
@@ -72,10 +72,12 @@ const ServiceAccountsListPage = ({
}
}, [fetchServiceAccounts, fetchACOptions]);
const onRoleChange = (role: OrgRole, serviceAccount: ServiceAccountDTO) => {
const onRoleChange = async (role: OrgRole, serviceAccount: ServiceAccountDTO) => {
const updatedServiceAccount = { ...serviceAccount, role: role };
updateServiceAccount(updatedServiceAccount);
await updateServiceAccount(updatedServiceAccount);
await fetchServiceAccounts();
};
return (
<Page navModel={navModel}>
<Page.Contents>