Api call from component itself and linting.

This commit is contained in:
2021-02-18 21:40:40 +01:00
parent eb9e7d4b43
commit cded690fba
2 changed files with 59 additions and 62 deletions

View File

@@ -23,7 +23,9 @@ export default {
};
},
async mounted() {
prelottery().then(wines => this.wines = wines);
fetch("/api/lottery/wines")
.then(resp => resp.json())
.then(response => (this.wines = response.wines));
}
};
</script>
@@ -42,19 +44,18 @@ h1 {
}
.wines-container {
display: flex;
flex-wrap: wrap;
justify-content: space-evenly;
margin: 0 2rem;
width: 90vw;
padding: 5vw;
@include desktop {
width: 80vw;
padding: 0 10vw;
}
@media (min-width: 1500px) {
max-width: 1500px;
margin: 0 auto;
}
@include mobile {
flex-direction: column;
}
}
h3 {
@@ -65,23 +66,6 @@ h3 {
}
}
.inner-wine-container {
display: flex;
flex-direction: row;
margin: auto;
width: 500px;
font-family: Arial;
margin-bottom: 30px;
@include desktop {
justify-content: center;
}
@include mobile {
width: auto;
}
}
.right {
display: flex;
flex-direction: column;