mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-08 14:35:03 +00:00
sort folders by name first and then sequence (#5063)
* sort folders by name first and then sequence --------- Co-authored-by: lohit <lohit@usebruno.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import {cloneDeep, isEqual, sortBy, filter, map, isString, findIndex, find, each, get } from 'lodash';
|
||||
import { uuid } from 'utils/common';
|
||||
import { sortByNameThenSequence } from 'utils/common/index';
|
||||
import path from 'utils/common/path';
|
||||
|
||||
const replaceTabsWithSpaces = (str, numSpaces = 2) => {
|
||||
@@ -1036,7 +1037,7 @@ export const getFormattedCollectionOauth2Credentials = ({ oauth2Credentials = []
|
||||
|
||||
export const resetSequencesInFolder = (folderItems) => {
|
||||
const items = folderItems;
|
||||
const sortedItems = items.sort((a, b) => a.seq - b.seq);
|
||||
const sortedItems = sortByNameThenSequence(items);
|
||||
return sortedItems.map((item, index) => {
|
||||
item.seq = index + 1;
|
||||
return item;
|
||||
|
||||
Reference in New Issue
Block a user