add endpoint for retrieving all requested wines
This commit is contained in:
@@ -24,6 +24,12 @@ const overallWineStatistics = () => {
|
||||
return fetch(url.href).then(resp => resp.json());
|
||||
};
|
||||
|
||||
const allRequestedWines = () => {
|
||||
const url = new URL("/api/wines/all-requested-wines", BASE_URL);
|
||||
|
||||
return fetch(url.href).then(resp => resp.json());
|
||||
};
|
||||
|
||||
const chartWinsByColor = () => {
|
||||
const url = new URL("/api/purchase/statistics/color", BASE_URL);
|
||||
|
||||
@@ -285,6 +291,7 @@ export {
|
||||
wineSchema,
|
||||
barcodeToVinmonopolet,
|
||||
searchForWine,
|
||||
allRequestedWines,
|
||||
login,
|
||||
register,
|
||||
addAttendee,
|
||||
|
||||
@@ -1,14 +1,27 @@
|
||||
<template>
|
||||
<main>
|
||||
<p>
|
||||
<h1>
|
||||
Alle viner
|
||||
</p>
|
||||
</h1>
|
||||
<section>
|
||||
{{this.wines}}
|
||||
</section>
|
||||
</main>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
import { allRequestedWines } from "@/api";
|
||||
|
||||
export default {
|
||||
data(){
|
||||
return{
|
||||
wines: undefined
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
const wines = await allRequestedWines();
|
||||
this.wines = wines
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user