From 781d6f1585e43c634b528c52e6947cd3cd717417 Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Tue, 20 Aug 2024 14:21:23 +0200 Subject: [PATCH] fix nosql ordering --- packages/web/src/datagrid/CollectionDataGridCore.svelte | 2 +- .../dbgate-plugin-mongo/src/frontend/convertToMongoCondition.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/web/src/datagrid/CollectionDataGridCore.svelte b/packages/web/src/datagrid/CollectionDataGridCore.svelte index 45f714ad..a7b256fc 100644 --- a/packages/web/src/datagrid/CollectionDataGridCore.svelte +++ b/packages/web/src/datagrid/CollectionDataGridCore.svelte @@ -66,7 +66,7 @@ if (sort?.length > 0) { return sort.map(col => ({ columnName: col.uniqueName, - order: col.order, + direction: col.order, })); } diff --git a/plugins/dbgate-plugin-mongo/src/frontend/convertToMongoCondition.js b/plugins/dbgate-plugin-mongo/src/frontend/convertToMongoCondition.js index 9c270e8a..f197152a 100644 --- a/plugins/dbgate-plugin-mongo/src/frontend/convertToMongoCondition.js +++ b/plugins/dbgate-plugin-mongo/src/frontend/convertToMongoCondition.js @@ -175,7 +175,7 @@ function convertToMongoSort(sort) { if (!sort) return null; return _zipObject( sort.map((col) => col.columnName), - sort.map((col) => (col.order == 'DESC' ? -1 : 1)) + sort.map((col) => (col.direction == 'DESC' ? -1 : 1)) ); }