From e89907d8b732630b534dcf72208202bf5851b417 Mon Sep 17 00:00:00 2001 From: dlohvinov Date: Mon, 18 Nov 2024 23:44:44 +0200 Subject: [PATCH] fix: sortFilterMixin.js restore sort [WTEL-5520](https://webitel.atlassian.net/browse/WTEL-5520) --- package.json | 2 +- .../QueryFilters/mixins/sortFilterMixin.js | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index ed631960..5ea028c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@webitel/ui-sdk", - "version": "24.10.82", + "version": "24.10.83", "private": false, "scripts": { "dev": "vite", diff --git a/src/modules/QueryFilters/mixins/sortFilterMixin.js b/src/modules/QueryFilters/mixins/sortFilterMixin.js index dd96079a..eebf5ed8 100644 --- a/src/modules/QueryFilters/mixins/sortFilterMixin.js +++ b/src/modules/QueryFilters/mixins/sortFilterMixin.js @@ -74,17 +74,14 @@ export default { restoreValue(value) { const sortedColumns = decodeSortQuery({ value }); + const [field, order] = Object.entries(sortedColumns)[0]; - debugger; - - // const sortedHeader = - - // const headers = changeHeadersSort({ headers: this.headers, sortedHeader: { field: sortedColumns[0] }, order }); + const headers = changeHeadersSort({ + headers: this.headers, + sortedHeader: { field }, + order, + }); - const headers = this.headers.map((header) => ({ - ...header, - sort: sortedColumns[header.field] || null, - })); this.setHeaders(headers); }, },