File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 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';
2323import { hardCodedRsCities } from './hardcodedCities' ;
2424import { useDebouncedValue , useViaCep } from '@/hooks' ;
2525import { cn } from '@/lib/utils' ;
26+ import { checkAndFormatAddress } from '@/components/CardAboutShelter' ;
27+ import { IUseShelterData } from '@/hooks/useShelter/types' ;
2628
2729const CreateShelterComponent = ( ) => {
2830 const navigate = useNavigate ( ) ;
@@ -74,7 +76,8 @@ const CreateShelterComponent = () => {
7476 } ) ,
7577 onSubmit : async ( values , { resetForm } ) => {
7678 try {
77- await ShelterServices . create ( values ) ;
79+ const address = checkAndFormatAddress ( values as IUseShelterData ) ;
80+ await ShelterServices . create ( { ...values , address } ) ;
7881 clearCache ( false ) ;
7982 toast ( {
8083 title : 'Cadastro feita com sucesso' ,
You can’t perform that action at this time.
0 commit comments