Skip to content

Commit

Permalink
Fixed submission table sort (#1077)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sai-CITZ authored Oct 11, 2023
1 parent a50d1c1 commit c6a7dfa
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions app/src/forms/common/models/views/submissionMetadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,10 @@ class SubmissionMetadata extends Model {
if (!pagination) {
builder.orderBy('createdAt', 'DESC');
} else {
let orderBy = params?.sortBy;
let orderDesc = params?.sortDesc;
if (orderDesc === 'true') {
builder.orderBy(orderBy, 'desc');
} else if (orderDesc === 'false') {
builder.orderBy(orderBy, 'asc');
let orderBy = params?.sortBy.column;
let orderDirection = params?.sortBy.order;
if (orderBy && orderDirection) {
builder.orderBy(orderBy, orderDirection);
}
}
},
Expand Down

0 comments on commit c6a7dfa

Please sign in to comment.