Feat/lottery endpoint #18

Merged
KevinMidboe merged 8 commits from feat/lottery-endpoint into master 2020-08-14 14:56:48 +00:00
2 changed files with 19 additions and 1 deletions
Showing only changes of commit 6633994940 - Show all commits

View File

@@ -245,6 +245,18 @@ const postWineChosen = (id, wineName) => {
});
};
const historyAll = () => {
const url = new URL(`/api/lottery/all`, BASE_URL);
return fetch(url.href).then(resp => {
if (resp.ok) {
return resp.json();
} else {
return handleErrors(resp);
}
});
}
export {
statistics,
colorStatistics,
@@ -270,5 +282,6 @@ export {
getChatHistory,
finishedDraw,
getAmIWinner,
postWineChosen
postWineChosen,
historyAll
};

View File

@@ -10,6 +10,7 @@ import AdminPage from "@/components/AdminPage";
import WinnerPage from "@/components/WinnerPage";
import LotteryPage from "@/components/LotteryPage";
import HistoryPage from "@/components/HistoryPage";
const routes = [
{
@@ -47,6 +48,10 @@ const routes = [
{
path: "/winner/:id",
component: WinnerPage
},
{
path: "/history",
component: HistoryPage
}
];