Fix/personal highscore page #50

Merged
KevinMidboe merged 2 commits from fix/personal-highscore-page into master 2020-10-11 16:49:18 +00:00
Showing only changes of commit f44402cf03 - Show all commits

View File

@@ -345,6 +345,19 @@ const historyByDate = (date) => {
}); });
} }
const getWinnerByName = (name) => {
const encodedName = encodeURIComponent(name)
const url = new URL(`/api/lottery/by-name/${name}`, BASE_URL);
return fetch(url.href).then(resp => {
if (resp.ok) {
return resp.json();
} else {
return handleErrors(resp);
}
})
}
export { export {
statistics, statistics,
colorStatistics, colorStatistics,
@@ -377,5 +390,6 @@ export {
getAmIWinner, getAmIWinner,
postWineChosen, postWineChosen,
historyAll, historyAll,
historyByDate historyByDate,
getWinnerByName
}; };