Skip to content

Commit

Permalink
feat: Sort list of categories
Browse files Browse the repository at this point in the history
Revert `getPapersByLabel` changes
see: c3f652d
  • Loading branch information
Merkur39 committed Nov 22, 2021
1 parent 616cc1d commit 3e23b25
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/components/Papers/PaperGroup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ const PaperGroup = () => {
return label
})
)
]
].sort(
(a, b) => (scannerT(`items.${a}`) > scannerT(`items.${b}`) && 1) || -1
)
: []

const goPapersList = useCallback(
Expand Down
7 changes: 3 additions & 4 deletions src/helpers/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ export const getAllQualificationLabel = papersDefinitions => {
type: 'file',
trashed: false
})
.indexFields(['metadata.qualification.label'])
.sortBy([{ 'metadata.qualification.label': 'desc' }]),
.indexFields(['metadata.qualification.label']),
options: {
as: `getAllQualificationLabel`,
fetchPolicy: defaultFetchPolicy
Expand All @@ -39,8 +38,8 @@ export const getPapersByLabel = label => ({
type: 'file',
trashed: false
})
.indexFields(['name', 'metadata.qualification'])
.sortBy([{ name: 'asc' }]),
.indexFields(['created_at', 'metadata.qualification'])
.sortBy([{ created_at: 'desc' }]),
options: {
as: `getPapersByLabel:${label}`,
fetchPolicy: defaultFetchPolicy
Expand Down

0 comments on commit 3e23b25

Please sign in to comment.