completionId: cgen-db67b3440ff14100bac7c7676f35923c
cgen-db67b3440ff14100bac7c7676f35923c
This commit is contained in:
parent
1994968d5b
commit
39f5133c96
1 changed files with 7 additions and 1 deletions
|
|
@ -1001,7 +1001,13 @@ export const aethexAchievementService = {
|
||||||
ensureSupabase();
|
ensureSupabase();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const resp = await fetch(`${API_BASE}/api/achievements/award`, {
|
const baseUrl = typeof window !== "undefined" ? window.location.origin : "";
|
||||||
|
if (!baseUrl) {
|
||||||
|
console.warn("[Achievement] Cannot award - no origin available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const resp = await fetch(`${baseUrl}/api/achievements/award`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue