diff --git a/client/lib/aethex-database-adapter.ts b/client/lib/aethex-database-adapter.ts index 8a271cbf..b1a943d3 100644 --- a/client/lib/aethex-database-adapter.ts +++ b/client/lib/aethex-database-adapter.ts @@ -718,6 +718,33 @@ export const aethexAchievementService = { } } }, + + async activateCommunityRewards(target?: { + email?: string; + username?: string; + }): Promise { + try { + const payload = { + targetEmail: target?.email, + targetUsername: target?.username, + }; + const response = await fetch("/api/achievements/activate", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(payload), + }); + + if (!response.ok) { + const errorText = await response.text(); + throw new Error(errorText || "Failed to activate community rewards"); + } + + return (await response.json()) as ActivateRewardsResponse; + } catch (error) { + console.warn("activateCommunityRewards failed:", error); + return null; + } + }, }; // Notification Service (uses existing notifications table)