diff --git a/src/components/dialog/CreateCityDialog.tsx b/src/components/dialog/CreateCityDialog.tsx index 8a8f2e1..6c389c4 100644 --- a/src/components/dialog/CreateCityDialog.tsx +++ b/src/components/dialog/CreateCityDialog.tsx @@ -30,8 +30,8 @@ export function CreateCityDialog({ handleClose, updateTable }: CreateCityDialogP const { state } = useStateContext(); const user = state.user as IUser; const { t } = useTranslation(['register', 'errorCodes', 'admin']); - const { createMutation: createCityMutation } = useCreateMutation( - `admin/countries/1/states/${user.state.id}/cities/`, + const { createMutation: createCityMutation, loading: mutationLoading } = useCreateMutation( + `countries/1/states/${user.state.id}/cities/`, ); const { enqueueSnackbar } = useSnackbar(); @@ -77,6 +77,7 @@ export function CreateCityDialog({ handleClose, updateTable }: CreateCityDialogP // eslint-disable-next-line @typescript-eslint/no-shadow, @typescript-eslint/no-explicit-any errorData?.errors?.forEach((error: any) => { + console.log(error); if (error?.field && watch(error.field)) { setError(error.field, { type: 'manual', @@ -158,7 +159,7 @@ export function CreateCityDialog({ handleClose, updateTable }: CreateCityDialogP
-
diff --git a/src/components/dialog/CreateTeamDialog.tsx b/src/components/dialog/CreateTeamDialog.tsx index 4ba80b9..fc46ff8 100644 --- a/src/components/dialog/CreateTeamDialog.tsx +++ b/src/components/dialog/CreateTeamDialog.tsx @@ -35,12 +35,14 @@ export function CreateTeamDialog({ handleClose, updateTable }: CreateTeamDialogP // const { state } = useStateContext(); // const user = state.user as IUser; const { t } = useTranslation(['register', 'errorCodes', 'admin', 'translation']); - const { createMutation: createTeamMutation } = useCreateMutation(`/teams`); + const { createMutation: createTeamMutation, loading: mutationLoading } = useCreateMutation( + `/teams`, + ); const [userOptions, setUserOptions] = useState([]); const [{ data: usersData, loading: loadingUsers }] = useAxios({ - url: '/users?filter[roles][name]=brigadista', + url: '/users?filter[roles][name]=brigadista&filter[without_team]=true', }); useEffect(() => { @@ -228,7 +230,7 @@ export function CreateTeamDialog({ handleClose, updateTable }: CreateTeamDialogP
-