fix endpoint
This commit is contained in:
		
							parent
							
								
									421f56b709
								
							
						
					
					
						commit
						1eb3fa41e6
					
				| 
						 | 
					@ -23,6 +23,7 @@ export default function Home() {
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        const response = await jsonResponse.json();
 | 
					        const response = await jsonResponse.json();
 | 
				
			||||||
 | 
					        console.log(response);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        setComments(response.message);
 | 
					        setComments(response.message);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -29,12 +29,12 @@ export default function LogIn({ navigation }) {
 | 
				
			||||||
    password: ""
 | 
					    password: ""
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
  const onHandleChange = (name) => (value) => setCredentials(prev => ({ ...prev, [name]: value }))
 | 
					  const onHandleChange = (name) => (value) => setCredentials(prev => ({ ...prev, [name]: value }))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const iniciarSesion = async () => {
 | 
					  const iniciarSesion = async () => {
 | 
				
			||||||
    try {
 | 
					    try {
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
 | 
					      console.log(baseURL);
 | 
				
			||||||
      await fetch(baseURL, {
 | 
					      await fetch(baseURL, {
 | 
				
			||||||
        cache: 'no-cache', 
 | 
					        cache: 'no-cache', 
 | 
				
			||||||
        method: 'POST', 
 | 
					        method: 'POST', 
 | 
				
			||||||
| 
						 | 
					@ -55,11 +55,12 @@ export default function LogIn({ navigation }) {
 | 
				
			||||||
        // inqulino 4 y guarda 63
 | 
					        // inqulino 4 y guarda 63
 | 
				
			||||||
         const user = response.message
 | 
					         const user = response.message
 | 
				
			||||||
          if(user.user_type == '4'){
 | 
					          if(user.user_type == '4'){
 | 
				
			||||||
 | 
					            addUser(user);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            navigation.navigate('Comunicados', {user})
 | 
					            navigation.navigate('Comunicados', {user})
 | 
				
			||||||
          }else if(user.user_type == '3'){
 | 
					          }else if(user.user_type == '3'){
 | 
				
			||||||
            addUser(user);
 | 
					            addUser(user);
 | 
				
			||||||
            navigation.navigate('Comunicados')
 | 
					            navigation.navigate('Comunicados', {user})
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
      
 | 
					      
 | 
				
			||||||
| 
						 | 
					@ -71,7 +72,6 @@ export default function LogIn({ navigation }) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return (
 | 
					  return (
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
    <Center w="100%">
 | 
					    <Center w="100%">
 | 
				
			||||||
      <Box safeArea p="2" py="8" w="90%" maxW="290">
 | 
					      <Box safeArea p="2" py="8" w="90%" maxW="290">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,3 @@
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
export class API {
 | 
					export class API {
 | 
				
			||||||
    static BASE_URL = "http://10.0.2.2:4000"
 | 
					    static BASE_URL = "http://localhost:4000"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue