award badges

This commit is contained in:
yohlo
2025-10-01 13:42:09 -05:00
parent 654041b6b6
commit 6224404aa9
7 changed files with 173 additions and 1 deletions

View File

@@ -22,3 +22,13 @@ export const getAllBadges = createServerFn()
.handler(async () =>
toServerResult(() => pbAdmin.listBadges())
);
export const awardManualBadge = createServerFn()
.inputValidator(z.object({
playerId: z.string(),
badgeId: z.string(),
}))
.middleware([superTokensAdminFunctionMiddleware])
.handler(async ({ data }) =>
toServerResult(() => pbAdmin.awardManualBadge(data.playerId, data.badgeId))
);