46 lines
1.6 KiB
TypeScript
46 lines
1.6 KiB
TypeScript
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 };
|
|
} |