From 7d8874c8cd3ff2c3b60585261abbd8395ac23da2 Mon Sep 17 00:00:00 2001 From: openhands Date: Sun, 11 Oct 2026 18:48:26 +0200 Subject: [PATCH] fix: biome lint suppressions + admin-badges.ts formatting --- src/actions/admin-badges.ts | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/src/actions/admin-badges.ts b/src/actions/admin-badges.ts index 8fa388f4..af74f842 100644 --- a/src/actions/admin-badges.ts +++ b/src/actions/admin-badges.ts @@ -13,8 +13,18 @@ export async function giveBadge(formData: FormData): Promise { // Support comma-separated userIds and/or codes for bulk operations const userIdInput = String(formData.get("userId") ?? "").trim(); const codeInput = String(formData.get("code") ?? "").trim(); - const userIds = userIdInput ? userIdInput.split(",").map((s) => s.trim()).filter(Boolean) : []; - const codes = codeInput ? codeInput.split(",").map((s) => s.trim()).filter(Boolean) : []; + const userIds = userIdInput + ? userIdInput + .split(",") + .map((s) => s.trim()) + .filter(Boolean) + : []; + const codes = codeInput + ? codeInput + .split(",") + .map((s) => s.trim()) + .filter(Boolean) + : []; if (userIds.length === 0 || codes.length === 0) { return; @@ -41,7 +51,10 @@ export async function giveBadge(formData: FormData): Promise { .select({ id: UsersBadges.id }) .from(UsersBadges) .where( - and(eq(UsersBadges.userId, Number(userId)), eq(UsersBadges.badgeCode, code)), + and( + eq(UsersBadges.userId, Number(userId)), + eq(UsersBadges.badgeCode, code), + ), ) .limit(1); if (!existing) { @@ -50,14 +63,15 @@ export async function giveBadge(formData: FormData): Promise { .from(UsersBadges) .where(eq(UsersBadges.userId, Number(userId))); const slotId = (agg?.maxSlot ?? 0) + 1; - await db.insert(UsersBadges).values({ userId: Number(userId), slotId, badgeCode: code }); + await db + .insert(UsersBadges) + .values({ userId: Number(userId), slotId, badgeCode: code }); } } catch { // Best-effort: the RCON grant already succeeded for online users. } } - revalidatePath("/admin/badges"); -} -; + revalidatePath("/admin/badges"); + } }