feat: add chair toggle to admin award juror management
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -477,6 +477,13 @@ export default function AwardDetailPage({
|
|||||||
const removeJuror = trpc.specialAward.removeJuror.useMutation({
|
const removeJuror = trpc.specialAward.removeJuror.useMutation({
|
||||||
onSuccess: () => utils.specialAward.listJurors.invalidate({ awardId }),
|
onSuccess: () => utils.specialAward.listJurors.invalidate({ awardId }),
|
||||||
})
|
})
|
||||||
|
const setChair = trpc.specialAward.setChair.useMutation({
|
||||||
|
onSuccess: () => {
|
||||||
|
utils.specialAward.listJurors.invalidate({ awardId })
|
||||||
|
toast.success('Chair status updated')
|
||||||
|
},
|
||||||
|
onError: () => toast.error('Failed to update chair status'),
|
||||||
|
})
|
||||||
const setWinner = trpc.specialAward.setWinner.useMutation({
|
const setWinner = trpc.specialAward.setWinner.useMutation({
|
||||||
onSuccess: invalidateAward,
|
onSuccess: invalidateAward,
|
||||||
})
|
})
|
||||||
@@ -1328,6 +1335,7 @@ export default function AwardDetailPage({
|
|||||||
<TableRow>
|
<TableRow>
|
||||||
<TableHead>Member</TableHead>
|
<TableHead>Member</TableHead>
|
||||||
<TableHead>Role</TableHead>
|
<TableHead>Role</TableHead>
|
||||||
|
<TableHead>Chair</TableHead>
|
||||||
<TableHead className="text-right">Actions</TableHead>
|
<TableHead className="text-right">Actions</TableHead>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
@@ -1352,6 +1360,15 @@ export default function AwardDetailPage({
|
|||||||
{j.user.role.replace('_', ' ')}
|
{j.user.role.replace('_', ' ')}
|
||||||
</Badge>
|
</Badge>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
<TableCell>
|
||||||
|
<Switch
|
||||||
|
checked={j.isChair}
|
||||||
|
onCheckedChange={(checked) =>
|
||||||
|
setChair.mutate({ awardId, userId: j.userId, isChair: checked })
|
||||||
|
}
|
||||||
|
disabled={setChair.isPending}
|
||||||
|
/>
|
||||||
|
</TableCell>
|
||||||
<TableCell className="text-right">
|
<TableCell className="text-right">
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
|
|||||||
Reference in New Issue
Block a user