Skip to content

Commit

Permalink
Fixed submission sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
Sai-CITZ committed Oct 10, 2023
1 parent 5f137fb commit e42069f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/frontend/src/components/forms/SubmissionsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,8 @@ export default {
},
async mounted() {
this.debounceInput = _.debounce(async () => {
this.forceTableRefresh += 1;
this.refreshSubmissions();
this.forceTableRefresh += 1;
}, 300);
this.refreshSubmissions();
Expand Down
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 e42069f

Please sign in to comment.