Skip to content

Commit

Permalink
sort query version select options (re getredash#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
spasovski authored and Marina Samuel committed May 25, 2018
1 parent b38fe67 commit e643114
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions client/app/pages/queries/compare-query-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ const CompareQueryDialog = {

$http.get(`/api/queries/${this.currentQuery.id}/version`).then((response) => {
this.versions = response.data;

const compare = (a, b) => {
if (a.object_version < b.object_version) {
return -1;
} else if (a.object_version > b.object_version) {
return 1;
}
return 0;
};

this.versions.sort(compare);
this.compareQueries(true);
});
}],
Expand Down

0 comments on commit e643114

Please sign in to comment.