Skip to content
Snippets Groups Projects
Commit 43456bfc authored by Ilia Eriomenco's avatar Ilia Eriomenco
Browse files

Merge branch 'main' of https://gitlab.coko.foundation/kotahi/kotahi into main

parents cff99423 e8c92697
No related branches found
No related tags found
No related merge requests found
......@@ -494,10 +494,13 @@ const resolvers = {
if (sort) {
const [sortName, sortDirection] = sort.split('_')
query.orderBy(ref(sortName), sortDirection)
// }
// // e.g. 'created_DESC' into 'created' and 'DESC' arguments
// query.orderBy(...sort.split('_'))
if (sortName.includes('submission:')) {
const fieldName = sortName.split(':')[1]
const result = `LOWER(submission->>'${fieldName}') ${sortDirection}`
query.orderByRaw(result)
} else {
query.orderBy(ref(sortName), sortDirection)
}
}
if (limit) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment