Fix sort with pagination and composite fields (#9150)
Fixes https://github.com/twentyhq/twenty/issues/8863 ## Description This PR fixes an issue with cursor-based pagination when dealing with composite fields (like `fullName`). Previously, the pagination direction was incorrectly determined for composite fields because the code wasn't properly handling nested object structures in the `orderBy` parameter. Refactored the code accordingly.
This commit is contained in:
+4
-1
@@ -48,7 +48,10 @@ export class GraphqlQueryOrderFieldParser {
|
||||
Object.assign(acc, compositeOrder);
|
||||
} else {
|
||||
acc[`"${objectNameSingular}"."${key}"`] =
|
||||
this.convertOrderByToFindOptionsOrder(value, isForwardPagination);
|
||||
this.convertOrderByToFindOptionsOrder(
|
||||
value as OrderByDirection,
|
||||
isForwardPagination,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user