File tree 1 file changed +4
-1
lines changed
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ import { clearCache } from '@/api/cache';
23
23
import { hardCodedRsCities } from './hardcodedCities' ;
24
24
import { useDebouncedValue , useViaCep } from '@/hooks' ;
25
25
import { cn } from '@/lib/utils' ;
26
+ import { checkAndFormatAddress } from '@/components/CardAboutShelter' ;
27
+ import { IUseShelterData } from '@/hooks/useShelter/types' ;
26
28
27
29
const CreateShelterComponent = ( ) => {
28
30
const navigate = useNavigate ( ) ;
@@ -74,7 +76,8 @@ const CreateShelterComponent = () => {
74
76
} ) ,
75
77
onSubmit : async ( values , { resetForm } ) => {
76
78
try {
77
- await ShelterServices . create ( values ) ;
79
+ const address = checkAndFormatAddress ( values as IUseShelterData ) ;
80
+ await ShelterServices . create ( { ...values , address } ) ;
78
81
clearCache ( false ) ;
79
82
toast ( {
80
83
title : 'Cadastro feita com sucesso' ,
You can’t perform that action at this time.
0 commit comments