feat: Adding economic system to do scoring
This commit is contained in:
@@ -48,4 +48,20 @@ export async function apiGetMe(token) {
|
||||
return fetch("/api/auth/me", {
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export async function apiFetchEconScores() {
|
||||
const res = await fetch("/api/econ-scores");
|
||||
if (!res.ok) throw new Error("econ_scores_fetch_failed");
|
||||
return res.json();
|
||||
}
|
||||
|
||||
export async function apiTickEconScores(seed, blue, red) {
|
||||
const res = await fetch("/api/econ-scores/tick", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ seed, blue, red }),
|
||||
});
|
||||
if (!res.ok) throw new Error("econ_tick_failed");
|
||||
return res.json();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user