mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -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,
|
query,
|
||||||
filters,
|
filters,
|
||||||
serviceAccountToRemove,
|
serviceAccountToRemove,
|
||||||
}: Props) => {
|
}: Props): JSX.Element => {
|
||||||
const styles = useStyles2(getStyles);
|
const styles = useStyles2(getStyles);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -72,10 +72,12 @@ const ServiceAccountsListPage = ({
|
|||||||
}
|
}
|
||||||
}, [fetchServiceAccounts, fetchACOptions]);
|
}, [fetchServiceAccounts, fetchACOptions]);
|
||||||
|
|
||||||
const onRoleChange = (role: OrgRole, serviceAccount: ServiceAccountDTO) => {
|
const onRoleChange = async (role: OrgRole, serviceAccount: ServiceAccountDTO) => {
|
||||||
const updatedServiceAccount = { ...serviceAccount, role: role };
|
const updatedServiceAccount = { ...serviceAccount, role: role };
|
||||||
updateServiceAccount(updatedServiceAccount);
|
await updateServiceAccount(updatedServiceAccount);
|
||||||
|
await fetchServiceAccounts();
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page navModel={navModel}>
|
<Page navModel={navModel}>
|
||||||
<Page.Contents>
|
<Page.Contents>
|
||||||
|
Loading…
Reference in New Issue
Block a user