New api route for history by date.

This commit is contained in:
2020-10-11 14:04:08 +02:00
committed by KevinMidboe
parent 0e74534cde
commit 90eb557f0b

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
};