kgabryje commented on code in PR #35683:
URL: https://github.com/apache/superset/pull/35683#discussion_r2672958577
##########
superset-frontend/plugins/plugin-chart-ag-grid-table/src/buildQuery.ts:
##########
@@ -253,13 +253,21 @@ const buildQuery: BuildQuery<TableChartFormData> = (
};
sortByFromOwnState = sortSource
- .map((sortItem: any) => {
- const colId = sortItem?.colId || sortItem?.key;
- const sortKey = mapColIdToIdentifier(colId);
- if (!sortKey) return null;
- const isDesc = sortItem?.sort === 'desc' || sortItem?.desc;
- return [sortKey, !isDesc] as QueryFormOrderBy;
- })
+ .map(
+ (sortItem: {
+ colId?: string;
+ key?: string;
+ sort?: string;
+ desc?: boolean;
+ }) => {
+ const colId = sortItem?.colId || sortItem?.key;
+ if (!colId) return null;
Review Comment:
Is it possible that a valid colId has value 0? If so, we can use isDefined
util here
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]