Feat/history page by date #46

Merged
KevinMidboe merged 6 commits from feat/history-page-by-date into master 2020-10-11 16:22:11 +00:00
Showing only changes of commit 90eb557f0b - Show all commits

View File

@@ -333,6 +333,18 @@ const historyAll = () => {
});
}
const historyByDate = (date) => {
const url = new URL(`/api/lottery/by-date/${ date }`, BASE_URL);
return fetch(url.href).then(resp => {
if (resp.ok) {
return resp.json();
} else {
return handleErrors(resp);
}
});
}
export {
statistics,
colorStatistics,
@@ -364,5 +376,6 @@ export {
finishedDraw,
getAmIWinner,
postWineChosen,
historyAll
historyAll,
historyByDate
};