Skip to content
Snippets Groups Projects
Verified Commit 09443556 authored by Louis-Olivier Brassard's avatar Louis-Olivier Brassard
Browse files

auteurs: Ordonner auteurs en ordre alphabetique

parent 5db413ba
No related branches found
No related tags found
No related merge requests found
...@@ -81,7 +81,19 @@ export default { ...@@ -81,7 +81,19 @@ export default {
self.$http.get(global.api + 'authors'/* + filterFr + 'access_token=' + self.token*/, {progress () { self.$http.get(global.api + 'authors'/* + filterFr + 'access_token=' + self.token*/, {progress () {
}}).then(function (response) { }}).then(function (response) {
var authors = JSON.parse(response.bodyText) 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) { }, function (response) {
console.log('Error retrieving authors', response) console.log('Error retrieving authors', response)
}).finally(function () { }).finally(function () {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment