12 lines
440 B
TypeScript
12 lines
440 B
TypeScript
import { useMutation } from "@tanstack/react-query";
|
|
import { updateTournament } from "@/features/tournaments/server";
|
|
import { TournamentFormInput } from "@/features/tournaments/types";
|
|
|
|
const useUpdateTournament = (tournamentId: string) => {
|
|
return useMutation({
|
|
mutationFn: (data: Partial<TournamentFormInput>) =>
|
|
updateTournament({ data: { id: tournamentId, updates: data } }),
|
|
});
|
|
};
|
|
|
|
export default useUpdateTournament; |