Feat/personal highscore #44

Merged
KevinMidboe merged 19 commits from feat/personal-highscore into master 2020-10-11 16:19:52 +00:00
Showing only changes of commit e87a59b1e6 - Show all commits

View File

@@ -333,6 +333,19 @@ const historyAll = () => {
});
}
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 {
statistics,
colorStatistics,
@@ -364,5 +377,6 @@ export {
finishedDraw,
getAmIWinner,
postWineChosen,
historyAll
historyAll,
getWinnerByName
};