feat(admin): ban appeals, photos polish, economy adjust, staff smoke
Deploy / release (push) Skipped
Deploy / deploy (push) Successful in 1m17s
CI / check (push) Successful in 25s
CI / deploy (push) Failing after 11s

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
SimoandCursor committed 2026-07-30 20:23:03 +02:00
1 parent fe46bd0544
commit 3ad3f9512c
36 files changed
+1185 -293

No files matched your search

+12 -10
View File
@@ -5,9 +5,9 @@ import Link from "next/link";
import { useState } from "react";
import { toast } from "sonner";
import {
bulkAdjustCurrency,
bulkBan,
bulkGiveBadge,
bulkGiveCurrency,
bulkUnban,
} from "@/actions/bulk-users";
import { DataTable } from "@/components/admin/data-table";
@@ -283,20 +283,20 @@ export function UsersTable({ data, canEdit, canBan }: UsersTableProps) {
if (pending?.kind !== "give-currency") return;
setBusy(true);
try {
const result = await bulkGiveCurrency({
const result = await bulkAdjustCurrency({
userIds: pending.ids,
amount: Number(currencyAmount),
type: currencyType,
});
if (result.ok) {
const data = result.data as {
given: number;
adjusted: number;
total: number;
failedIds: { userId: number; reason: string }[];
};
reportResult(
`Given ${currencyAmount} ${currencyType}`,
data.given,
`Adjusted ${currencyAmount} ${currencyType}`,
data.adjusted,
data.total,
data.failedIds.length,
);
@@ -344,7 +344,7 @@ export function UsersTable({ data, canEdit, canBan }: UsersTableProps) {
bulkActions.push({ label: "Unban", value: "unban" });
}
if (canEdit) {
bulkActions.push({ label: "Give credits", value: "give-currency" });
bulkActions.push({ label: "Adjust currency", value: "give-currency" });
bulkActions.push({ label: "Give badge", value: "give-badge" });
}
@@ -424,7 +424,7 @@ export function UsersTable({ data, canEdit, canBan }: UsersTableProps) {
<DialogContent>
<DialogHeader>
<DialogTitle>
Give currency to{" "}
Adjust currency for{" "}
{pending?.kind === "give-currency" ? pending.ids.length : 0} users
</DialogTitle>
</DialogHeader>
@@ -459,7 +459,9 @@ export function UsersTable({ data, canEdit, canBan }: UsersTableProps) {
</Select>
</div>
<div>
<Label htmlFor="give-amount">Amount</Label>
<Label htmlFor="give-amount">
Amount (positive = give, negative = take)
</Label>
<Input
id="give-amount"
type="number"
@@ -478,9 +480,9 @@ export function UsersTable({ data, canEdit, canBan }: UsersTableProps) {
</Button>
<Button
onClick={confirmGiveCurrency}
disabled={busy || !currencyAmount}
disabled={busy || !currencyAmount || Number(currencyAmount) === 0}
>
Give
Apply
</Button>
</DialogFooter>
</DialogContent>