fix: typecheck event prizes form for deploy gate
Local Build and Deploy / deploy (push) Failing after 1m25s
Local Build and Deploy / deploy (push) Failing after 1m25s
Narrow prizeType to the Select union and keep badgeCode as a string so pnpm typecheck passes on the server. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
1 parent
557138e40b
commit
1273f9aa46
1 file changed
+7
-3
@@ -17,6 +17,8 @@ import {
|
||||
} from "@/components/ui/select";
|
||||
import { useServerAction } from "@/hooks/use-server-action";
|
||||
|
||||
type PrizeType = "badge" | "credits" | "pixels" | "points" | "item";
|
||||
|
||||
interface Prize {
|
||||
id: number;
|
||||
position: number;
|
||||
@@ -39,7 +41,7 @@ export function EventPrizesManager({ eventId, prizes }: Props) {
|
||||
const [showForm, setShowForm] = useState(false);
|
||||
const [form, setForm] = useState({
|
||||
position: prizes.length + 1,
|
||||
prizeType: "badge" as string,
|
||||
prizeType: "badge" as PrizeType,
|
||||
badgeCode: "",
|
||||
credits: 0,
|
||||
pixels: 0,
|
||||
@@ -93,7 +95,9 @@ export function EventPrizesManager({ eventId, prizes }: Props) {
|
||||
<Label>Type</Label>
|
||||
<Select
|
||||
value={form.prizeType}
|
||||
onValueChange={(v) => setForm({ ...form, prizeType: v })}
|
||||
onValueChange={(v) =>
|
||||
setForm({ ...form, prizeType: v as PrizeType })
|
||||
}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValue />
|
||||
@@ -110,7 +114,7 @@ export function EventPrizesManager({ eventId, prizes }: Props) {
|
||||
<div className="space-y-1">
|
||||
<Label>Badge Code</Label>
|
||||
<Input
|
||||
value={form.badgeCode}
|
||||
value={form.badgeCode ?? ""}
|
||||
onChange={(e) =>
|
||||
setForm({ ...form, badgeCode: e.target.value })
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user