Added rating-sorting

This commit is contained in:
Kasper Rynning-Tønnesen
2020-02-10 15:52:50 +01:00
parent 55788a8fe5
commit 9e6d352934

View File

@@ -46,7 +46,9 @@ export default {
},
async mounted() {
const _wines = await fetch("/api/wines/statistics/overall");
this.wines = await _wines.json();
this.wines = (await _wines.json()).sort((a, b) =>
a.rating > b.rating ? -1 : 1
);
}
};
</script>