From 1eb3fa41e6727598a2841a03a3ed04cca1e5a99a Mon Sep 17 00:00:00 2001 From: Maria Sanchez Date: Mon, 22 Aug 2022 18:10:59 -0600 Subject: [PATCH] fix endpoint --- mobile-ui/components/Home.js | 1 + mobile-ui/components/LogIn.js | 6 +++--- mobile-ui/environment/api.js | 4 +--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/mobile-ui/components/Home.js b/mobile-ui/components/Home.js index 8727cae2..aa14e849 100644 --- a/mobile-ui/components/Home.js +++ b/mobile-ui/components/Home.js @@ -23,6 +23,7 @@ export default function Home() { }) const response = await jsonResponse.json(); + console.log(response); setComments(response.message); diff --git a/mobile-ui/components/LogIn.js b/mobile-ui/components/LogIn.js index b1a07c4b..489acfb9 100644 --- a/mobile-ui/components/LogIn.js +++ b/mobile-ui/components/LogIn.js @@ -29,12 +29,12 @@ export default function LogIn({ navigation }) { password: "" }); - const onHandleChange = (name) => (value) => setCredentials(prev => ({ ...prev, [name]: value })) const iniciarSesion = async () => { try { + console.log(baseURL); await fetch(baseURL, { cache: 'no-cache', method: 'POST', @@ -55,11 +55,12 @@ export default function LogIn({ navigation }) { // inqulino 4 y guarda 63 const user = response.message if(user.user_type == '4'){ + addUser(user); navigation.navigate('Comunicados', {user}) }else if(user.user_type == '3'){ addUser(user); - navigation.navigate('Comunicados') + navigation.navigate('Comunicados', {user}) } }) @@ -71,7 +72,6 @@ export default function LogIn({ navigation }) { return ( -
diff --git a/mobile-ui/environment/api.js b/mobile-ui/environment/api.js index ee61286d..a6148df3 100644 --- a/mobile-ui/environment/api.js +++ b/mobile-ui/environment/api.js @@ -1,5 +1,3 @@ - - export class API { - static BASE_URL = "http://10.0.2.2:4000" + static BASE_URL = "http://localhost:4000" }