mirror of
https://github.com/grafana/grafana.git
synced 2025-02-10 23:55:47 -06:00
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:
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>
|
||||
|
Loading…
Reference in New Issue
Block a user