better sorting on rating

This commit is contained in:
Kasper Rynning-Tønnesen
2020-01-27 10:16:53 +01:00
parent f3ea80343a
commit bdc9ceac71

View File

@@ -34,7 +34,7 @@ export default {
response.sort(); response.sort();
response = response response = response
.filter(wine => wine.name != null && wine.name != "") .filter(wine => wine.name != null && wine.name != "")
.sort((a, b) => (a.occurences > b.occurences ? -1 : 1)); .sort((a, b) => (a.rating > b.rating ? -1 : 1));
this.wines = response.slice(0, 5); this.wines = response.slice(0, 5);
}, },
methods: { methods: {