Skip to content

Commit

Permalink
removed extra sort() to allow to sorting by frequency in columns
Browse files Browse the repository at this point in the history
  • Loading branch information
BboyAkers committed Nov 19, 2024
1 parent 65939e4 commit cddddc4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/functions/instance/getTableData.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export default async ({ schema, table, filtered, pageSize, onlyCached, sorted, p

// sort columns, but keep primary key / hash attribute first, and created and updated last.
// NOTE: __created__ and __updated__ might not exist in the schema, only include if they exist.
const orderedColumns = allAttributes.filter((a) => ![hashAttribute, '__createdtime__', '__updatedtime__'].includes(a)).sort();
const orderedColumns = allAttributes.filter((a) => ![hashAttribute, '__createdtime__', '__updatedtime__'].includes(a))
const newEntityAttributes = orderedColumns.reduce((ac, a) => ({ ...ac, [a]: null }), {});

if (allAttributes.includes('__createdtime__')) orderedColumns.push('__createdtime__');
Expand Down

0 comments on commit cddddc4

Please sign in to comment.