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:
@ -18,7 +18,9 @@ export enum OrderByDirection {
|
||||
}
|
||||
|
||||
export type ObjectRecordOrderBy = Array<{
|
||||
[Property in keyof ObjectRecord]?: OrderByDirection;
|
||||
[Property in keyof ObjectRecord]?:
|
||||
| OrderByDirection
|
||||
| Record<string, OrderByDirection>;
|
||||
}>;
|
||||
|
||||
export interface ObjectRecordDuplicateCriteria {
|
||||
|
||||
Reference in New Issue
Block a user