Skip to content

Commit bed797c

Browse files
Fix connection pagination with sorting (#2239)
<!-- Ensure the title clearly reflects what was changed. Provide a clear and concise description of the changes made. The PR should only contain the changes related to the issue, and no other unrelated changes. --> Fixes OPS-4153
1 parent ccded39 commit bed797c

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

packages/server/api/src/app/app-connection/app-connection-service/app-connection-service.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ export const appConnectionService = {
256256
customPaginationColumn: {
257257
columnPath: sortingConfig.columnPath,
258258
columnName: sortingConfig.columnName,
259+
columnType: sortingConfig.columnType,
259260
},
260261
});
261262

@@ -579,6 +580,7 @@ function resolveAppConnectionSorting({
579580
}): {
580581
columnPath: string;
581582
columnName: string;
583+
columnType?: string;
582584
order: 'ASC' | 'DESC';
583585
} {
584586
const resolvedSortBy = sortBy ?? DEFAULT_APP_CONNECTION_SORT_BY;
@@ -587,11 +589,12 @@ function resolveAppConnectionSorting({
587589

588590
const sortByToColumnMap: Record<
589591
AppConnectionSortBy,
590-
{ columnPath: string; columnName: string }
592+
{ columnPath: string; columnName: string; columnType?: string }
591593
> = {
592594
[AppConnectionSortBy.NAME]: {
593595
columnPath: 'name',
594596
columnName: 'app_connection.name',
597+
columnType: 'string',
595598
},
596599
[AppConnectionSortBy.CREATED]: {
597600
columnPath: 'created',

packages/server/api/test/unit/app-connection/app-connection-service.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ describe('appConnectionService.list', () => {
235235
customPaginationColumn: {
236236
columnPath: 'updated',
237237
columnName: 'app_connection.updated',
238+
columnType: undefined,
238239
},
239240
});
240241

@@ -268,6 +269,7 @@ describe('appConnectionService.list', () => {
268269
customPaginationColumn: {
269270
columnPath: 'name',
270271
columnName: 'app_connection.name',
272+
columnType: 'string',
271273
},
272274
});
273275
});

0 commit comments

Comments
 (0)