Chart functions moved to /api.js
This commit is contained in:
17
src/api.js
17
src/api.js
@@ -29,6 +29,21 @@ const overallWineStatistics = () => {
|
||||
}
|
||||
|
||||
|
||||
const chartWinsByColor = () => {
|
||||
const url = new URL("/api/purchase/statistics/color", BASE_URL)
|
||||
|
||||
return fetch(url.href)
|
||||
.then(resp => resp.json())
|
||||
}
|
||||
|
||||
const chartPurchaseByColor = () => {
|
||||
const url = new URL("/api/purchase/statistics", BASE_URL)
|
||||
|
||||
return fetch(url.href)
|
||||
.then(resp => resp.json())
|
||||
}
|
||||
|
||||
|
||||
const prelottery = () => {
|
||||
const url = new URL("/api/wines/prelottery", BASE_URL)
|
||||
|
||||
@@ -150,6 +165,8 @@ export {
|
||||
colorStatistics,
|
||||
highscoreStatistics,
|
||||
overallWineStatistics,
|
||||
chartWinsByColor,
|
||||
chartPurchaseByColor,
|
||||
prelottery,
|
||||
log,
|
||||
logWines,
|
||||
|
||||
Reference in New Issue
Block a user