mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 01:18:23 +00:00
updates the exposed vars (#4426)
This commit is contained in:
parent
ceed17a0a7
commit
b36461b161
1 changed files with 5 additions and 5 deletions
|
|
@ -427,20 +427,20 @@ export function Table({
|
|||
|
||||
const columnName = columns.find((column) => column.id === state?.sortBy?.[0]?.id).accessor;
|
||||
|
||||
return {
|
||||
sortedBy: {
|
||||
return [
|
||||
{
|
||||
column: columnName,
|
||||
direction: state?.sortBy?.[0]?.desc ? 'desc' : 'asc',
|
||||
},
|
||||
};
|
||||
];
|
||||
}, [JSON.stringify(state)]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!sortOptions) {
|
||||
setExposedVariable('sortedBy', null);
|
||||
setExposedVariable('sortApplied', []);
|
||||
return;
|
||||
}
|
||||
setExposedVariable('sortedBy', sortOptions.sortedBy).then(() => fireEvent('onSort'));
|
||||
setExposedVariable('sortApplied', sortOptions).then(() => fireEvent('onSort'));
|
||||
}, [sortOptions]);
|
||||
|
||||
registerAction(
|
||||
|
|
|
|||
Loading…
Reference in a new issue