I have a simple function that returns 2 values, I hoped I could destructure the return of the function into the sort
and sortOrder
in the filters object, but if I do that I get the error:
Property 'sort' does not exist on type 'DashboardSortingPreferences'.
const { this.filters.sort, this.filters.sortorder } = this.dashboardColumnSortingService.initializeDashboardSortProperties(
this.user,
this.dashboardName,
);
const { sorted_column, direction } = this.dashboardColumnSortingService.initializeDashboardSortProperties(
this.user,
this.dashboardName,
);
this.filters.sort = sorted_column;
this.filters.sortorder = direction;
This works, and I understand why, but I was wondering if it was possible to set the sort_column
and direction
directly on the sort
and sortOrder
properties.