Feat/lottery endpoint #18
15
src/api.js
15
src/api.js
@@ -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 {
|
export {
|
||||||
statistics,
|
statistics,
|
||||||
colorStatistics,
|
colorStatistics,
|
||||||
@@ -270,5 +282,6 @@ export {
|
|||||||
getChatHistory,
|
getChatHistory,
|
||||||
finishedDraw,
|
finishedDraw,
|
||||||
getAmIWinner,
|
getAmIWinner,
|
||||||
postWineChosen
|
postWineChosen,
|
||||||
|
historyAll
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import AdminPage from "@/components/AdminPage";
|
|||||||
|
|
||||||
import WinnerPage from "@/components/WinnerPage";
|
import WinnerPage from "@/components/WinnerPage";
|
||||||
import LotteryPage from "@/components/LotteryPage";
|
import LotteryPage from "@/components/LotteryPage";
|
||||||
|
import HistoryPage from "@/components/HistoryPage";
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
{
|
{
|
||||||
@@ -47,6 +48,10 @@ const routes = [
|
|||||||
{
|
{
|
||||||
path: "/winner/:id",
|
path: "/winner/:id",
|
||||||
component: WinnerPage
|
component: WinnerPage
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/history",
|
||||||
|
component: HistoryPage
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user