Skip to content

Commit

Permalink
Review
Browse files Browse the repository at this point in the history
  • Loading branch information
rique223 committed Nov 6, 2023
1 parent 6cd9b67 commit 407671f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/meteor/client/views/invite/InvitePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const InvitePage = (): ReactElement => {

const token = useRouteParameter('hash');
const userId = useUserId();
const { isLoading, data: isValidInvite } = useValidateInviteQuery(userId ?? '', token ?? '');
const { isLoading, data: isValidInvite } = useValidateInviteQuery(userId, token);

const getInviteRoomMutation = useInviteTokenMutation();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { useQuery } from '@tanstack/react-query';

import { useInviteTokenMutation } from './useInviteTokenMutation';

export const useValidateInviteQuery = (userId: string, token: string) => {
export const useValidateInviteQuery = (userId: string | null, token: string | undefined) => {
const t = useTranslation();

const registrationForm = useSetting('Accounts_RegistrationForm');

const setLoginDefaultState = useSessionDispatch('loginDefaultState');
const dispatchToastMessage = useToastMessageDispatch();
const mutateInviteToken = useInviteTokenMutation();
const getInviteRoomMutation = useInviteTokenMutation();

const handleValidateInviteToken = useEndpoint('POST', '/v1/validateInviteToken');

Expand Down Expand Up @@ -46,7 +46,7 @@ export const useValidateInviteQuery = (userId: string, token: string) => {
return;
}

return mutateInviteToken(token);
return getInviteRoomMutation(token);
},
},
);
Expand Down

0 comments on commit 407671f

Please sign in to comment.