Skip to content

Commit

Permalink
added sortby treatmentTitle to 'treatments'
Browse files Browse the repository at this point in the history
  • Loading branch information
punkish committed Jul 18, 2020
1 parent 4a4675a commit c9f7d55
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/v2/lib/dd2queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ const calcSortParams = function(sortBy, queryObject) {
sortcol = sortBy.defaultSort.col;
}

if (sortdir !== 'ASC' || sortdir !== 'DESC') {
if (sortdir !== 'ASC' && sortdir !== 'DESC') {
sortdir = sortBy.defaultSort.dir
}

Expand Down
5 changes: 4 additions & 1 deletion api/v2/lib/qparts.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ const queryParts = {
tables: ['treatments'],
constraint: ['treatments.deleted = 0'],
sortBy: {
columns: ['journalYear'],
columns: [
'journalYear',
'treatmentTitle'
],
defaultSort: {
col: 'journalYear',
dir: 'ASC'
Expand Down
Binary file added assets/data-model.monopic
Binary file not shown.

0 comments on commit c9f7d55

Please sign in to comment.