fixes refresh issue (#343)

* fixes refresh issue
This commit is contained in:
Erik Jan de Wit 2021-01-29 11:33:18 +01:00 committed by GitHub
parent a73b2d3a4b
commit acf77df64c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -160,6 +160,7 @@ export function KeycloakDataTable<T>({
},
(result) => {
setRows(result);
setFilteredData(result);
setLoading(false);
}
);
@ -195,7 +196,9 @@ export function KeycloakDataTable<T>({
_.cloneDeep(actions).map((action: Action<T>, index: number) => {
delete action.onRowClick;
action.onClick = async (_, rowIndex) => {
const result = await actions[index].onRowClick!(rows![rowIndex].data);
const result = await actions[index].onRowClick!(
(filteredData || rows)![rowIndex].data
);
if (result) {
refresh();
}