Skip to content

Commit

Permalink
Merge pull request #193 from webitel/fix/crm-contacts-sort
Browse files Browse the repository at this point in the history
fix: crm contacrs sort fix [WTEL-4060]
  • Loading branch information
dlohvinov authored Dec 15, 2023
2 parents 90abdfb + 4919b48 commit 4380c76
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/modules/TableStoreModule/store/TableStoreModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,15 @@ export default class TableStoreModule extends BaseStoreModule {
});
},
UPDATE_HEADER_SORT: (context, { header, nextSortOrder }) => {
const headers = context.state.headers.map((oldHeader) => ({
...oldHeader,
sort: oldHeader.field === header.field
? nextSortOrder
: SortSymbols.NONE,
}));
const headers = context.state.headers.map((oldHeader) => {
const sortFieldValue = oldHeader?.sort;
return {
...oldHeader,
sort: oldHeader.field === header.field
? nextSortOrder
: sortFieldValue,
};
});
context.commit('SET_HEADERS', headers);
},
PATCH_ITEM_PROPERTY: async (context, {
Expand Down

0 comments on commit 4380c76

Please sign in to comment.