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 11:05:37 +03:00 committed by GitHub
parent d73bd617f0
commit 483319f1cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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>