From 78ea3d413ceb82d6cec2bb2cdfbad6874e7d90ae Mon Sep 17 00:00:00 2001 From: Santiago Date: Sun, 11 Feb 2024 17:08:09 +0100 Subject: [PATCH] =?UTF-8?q?Explicaci=C3=B3n=20llamadas=20a=20servicios=20d?= =?UTF-8?q?esde=20React?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapp/src/components/AddUser.js | 1 + webapp/src/components/Login.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/webapp/src/components/AddUser.js b/webapp/src/components/AddUser.js index 00d522a..e039a35 100644 --- a/webapp/src/components/AddUser.js +++ b/webapp/src/components/AddUser.js @@ -13,6 +13,7 @@ const AddUser = () => { const addUser = async () => { try { + // Esto manda una petición post adduser al gateway, que se lo reenvía a userservice await axios.post(`${apiEndpoint}/adduser`, { username, password }); setOpenSnackbar(true); } catch (error) { diff --git a/webapp/src/components/Login.js b/webapp/src/components/Login.js index 0ad6268..5e7e3dc 100644 --- a/webapp/src/components/Login.js +++ b/webapp/src/components/Login.js @@ -15,10 +15,11 @@ const Login = () => { const loginUser = async () => { try { + // Esto manda una petición post login al gateway, que se lo reenvía a authservice const response = await axios.post(`${apiEndpoint}/login`, { username, password }); // Extract data from the response - const { createdAt: userCreatedAt } = response.data; + const userCreatedAt = response.data.createdAt; setCreatedAt(userCreatedAt); setLoginSuccess(true);