diff --git a/src/components/AuthorsComponent.vue b/src/components/AuthorsComponent.vue index 1cbe67b4ac99c6b8721edd2653fb88f9591e7a5a..090ae9e29d95cb78e345fb2aa18fc1edb25a61fa 100644 --- a/src/components/AuthorsComponent.vue +++ b/src/components/AuthorsComponent.vue @@ -81,7 +81,19 @@ export default { self.$http.get(global.api + 'authors'/* + filterFr + 'access_token=' + self.token*/, {progress () { }}).then(function (response) { var authors = JSON.parse(response.bodyText) - self.$set(this, 'dataAuthors', authors) + + // order authors alphabetically + function compare (a, b) { + if (a.versions[0].name < b.versions[0].name) { + return -1 + } + if (a.versions[0].name > b.versions[0].name) { + return 1 + } + return 0 + } + + self.$set(this, 'dataAuthors', authors.sort(compare)) }, function (response) { console.log('Error retrieving authors', response) }).finally(function () {