page wrapper

This commit is contained in:
2026-01-07 12:40:52 +01:00
parent e589c30bf8
commit 0db80fa98d
128 changed files with 7386 additions and 8096 deletions

View File

@@ -0,0 +1,46 @@
import { usePageMutation } from '@/lib/page/usePageData';
export function useLeagueStewardingMutations(onRefetch: () => void) {
const acceptProtestMutation = usePageMutation(
async (variables: { protestId: string; penaltyType: string; penaltyValue: number; stewardNotes: string; raceId: string; accusedDriverId: string; reason: string }) => {
// TODO: Implement protest review and penalty application
// await leagueStewardingService.reviewProtest({
// protestId: variables.protestId,
// stewardId: currentDriverId,
// decision: 'uphold',
// decisionNotes: variables.stewardNotes,
// });
// await leagueStewardingService.applyPenalty({
// raceId: variables.raceId,
// driverId: variables.accusedDriverId,
// stewardId: currentDriverId,
// type: variables.penaltyType,
// value: variables.penaltyValue,
// reason: variables.reason,
// protestId: variables.protestId,
// notes: variables.stewardNotes,
// });
},
{
onSuccess: () => onRefetch(),
}
);
const rejectProtestMutation = usePageMutation(
async (variables: { protestId: string; stewardNotes: string }) => {
// TODO: Implement protest rejection
// await leagueStewardingService.reviewProtest({
// protestId: variables.protestId,
// stewardId: currentDriverId,
// decision: 'dismiss',
// decisionNotes: variables.stewardNotes,
// });
},
{
onSuccess: () => onRefetch(),
}
);
return { acceptProtestMutation, rejectProtestMutation };
}