From daa2ee20f720c990f567845c05c03fb8d91a17a5 Mon Sep 17 00:00:00 2001 From: gabriellsh Date: Mon, 15 Aug 2022 18:28:14 -0300 Subject: [PATCH 1/2] fix object destructuring --- .../views/teams/CreateTeamModal/useCreateTeamModalState.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/meteor/client/views/teams/CreateTeamModal/useCreateTeamModalState.ts b/apps/meteor/client/views/teams/CreateTeamModal/useCreateTeamModalState.ts index d2ebce384f13..4b0508c6b542 100644 --- a/apps/meteor/client/views/teams/CreateTeamModal/useCreateTeamModalState.ts +++ b/apps/meteor/client/views/teams/CreateTeamModal/useCreateTeamModalState.ts @@ -91,8 +91,8 @@ export const useCreateTeamModalState = (onClose: () => void): CreateTeamModalSta return; } - const isNotAvailable = await teamNameExists({ roomName: name }); - if (isNotAvailable) { + const { exists } = await teamNameExists({ roomName: name }); + if (exists) { setNameError(t('Teams_Errors_team_name', { name })); } }, From a094d1c6aaf7c3c757f7885a1026327dd4a468f4 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Tue, 16 Aug 2022 10:07:56 -0300 Subject: [PATCH 2/2] Update useCreateTeamModalState.ts --- .../views/teams/CreateTeamModal/useCreateTeamModalState.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/meteor/client/views/teams/CreateTeamModal/useCreateTeamModalState.ts b/apps/meteor/client/views/teams/CreateTeamModal/useCreateTeamModalState.ts index 4b0508c6b542..20bfd6135a19 100644 --- a/apps/meteor/client/views/teams/CreateTeamModal/useCreateTeamModalState.ts +++ b/apps/meteor/client/views/teams/CreateTeamModal/useCreateTeamModalState.ts @@ -71,7 +71,6 @@ export const useCreateTeamModalState = (onClose: () => void): CreateTeamModalSta const [nameError, setNameError] = useState(); const teamNameExists = useEndpoint('GET', '/v1/rooms.nameExists'); - // const teamNameExists = useMethod('roomNameExists'); const checkName = useDebouncedCallback( async (name: string) => {