From 483319f1cbdc899a3b5fc2f25fb317f105692c24 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Mon, 16 May 2022 11:05:37 +0300 Subject: [PATCH] ServiceAccounts: Fix org role picker update issue (#48958) * ServiceAccounts: Fix org role picker update issue * Do not use React.FC --- .../features/serviceaccounts/ServiceAccountsListPage.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/public/app/features/serviceaccounts/ServiceAccountsListPage.tsx b/public/app/features/serviceaccounts/ServiceAccountsListPage.tsx index f06120a2dbf..5527c781ffd 100644 --- a/public/app/features/serviceaccounts/ServiceAccountsListPage.tsx +++ b/public/app/features/serviceaccounts/ServiceAccountsListPage.tsx @@ -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 (