Skip to content

Commit

Permalink
add competition to all routes
Browse files Browse the repository at this point in the history
  • Loading branch information
FinnIckler committed Oct 26, 2024
1 parent 368efa6 commit 5a4afc3
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default function CompetingStep({

const queryClient = useQueryClient();
const { mutate: updateRegistrationMutation, isPending: isUpdating } = useMutation({
mutationFn: updateRegistration,
mutationFn: (body) => updateRegistration(competitionInfo, body),
onError: (data) => {
const { error } = data.json;
dispatch(setMessage(
Expand Down Expand Up @@ -117,7 +117,7 @@ export default function CompetingStep({
});

const { mutate: createRegistrationMutation, isLoading: isCreating } = useMutation({
mutationFn: submitEventRegistration,
mutationFn: (body) => submitEventRegistration(competitionInfo, body),
onError: (data) => {
const { error } = data.json;
dispatch(setMessage(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function RegistrationOverview({
const queryClient = useQueryClient();

const { mutate: deleteRegistrationMutation, isPending: isDeleting } = useMutation({
mutationFn: () => updateRegistration({
mutationFn: () => updateRegistration(competitionInfo, {
user_id: registration.user_id,
competition_id: competitionInfo.id,
competing: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function Register({
refetch,
} = useQuery({
queryKey: ['registration', competitionInfo.id, userInfo.id],
queryFn: () => getSingleRegistration(userInfo.id, competitionInfo.id),
queryFn: () => getSingleRegistration(userInfo.id, competitionInfo),
onError: (data) => {
const { error } = data.json;
dispatch(setMessage(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export default function RegistrationAdministrationList({ competitionInfo }) {
refetch,
} = useQuery({
queryKey: ['registrations-admin', competitionInfo.id],
queryFn: () => getAllRegistrations(competitionInfo.id),
queryFn: () => getAllRegistrations(competitionInfo),
refetchOnWindowFocus: false,
refetchOnReconnect: false,
staleTime: Infinity,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function RegistrationEditor({ competitor, competitionInfo }) {

const { isLoading: isRegistrationLoading, data: serverRegistration, refetch } = useQuery({
queryKey: ['registration-admin', competitionInfo.id, competitor.id],
queryFn: () => getSingleRegistration(competitor.id, competitionInfo.id),
queryFn: () => getSingleRegistration(competitor.id, competitionInfo),
refetchOnWindowFocus: false,
refetchOnReconnect: false,
staleTime: Infinity,
Expand All @@ -56,7 +56,7 @@ export default function RegistrationEditor({ competitor, competitionInfo }) {
});

const { mutate: updateRegistrationMutation, isPending: isUpdating } = useMutation({
mutationFn: updateRegistration,
mutationFn: (body) => updateRegistration(competitionInfo, body),
onError: (data) => {
const { error } = data.json;
dispatch(setMessage(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function FooterContent({
export default function RegistrationList({ competitionInfo }) {
const { isLoading: registrationsLoading, data: registrations, isError } = useQuery({
queryKey: ['registrations', competitionInfo.id],
queryFn: () => getConfirmedRegistrations(competitionInfo.id),
queryFn: () => getConfirmedRegistrations(competitionInfo),
retry: false,
});

Expand Down

0 comments on commit 5a4afc3

Please sign in to comment.