From 8b09f2812f49af81cf79f911a9bf6683ff9c87f7 Mon Sep 17 00:00:00 2001 From: Maria Sanchez Date: Wed, 31 Aug 2022 22:14:08 -0600 Subject: [PATCH] fix reservas --- mobile-ui/components/AreaComun.js | 21 ++++++------------- mobile-ui/components/Profile.js | 15 +++++++------ .../src/users/users.controller.ts | 4 +++- servicio-usuarios/src/users/users.service.ts | 5 ++++- 4 files changed, 22 insertions(+), 23 deletions(-) diff --git a/mobile-ui/components/AreaComun.js b/mobile-ui/components/AreaComun.js index 80256919..42d0d224 100644 --- a/mobile-ui/components/AreaComun.js +++ b/mobile-ui/components/AreaComun.js @@ -20,13 +20,10 @@ export default function AreaComun({navigation}){ const [service, setService] = useState(""); const [areas, setAreas] = useState([]) const [isRequesting, setIsRequesting] = useState(false); - const [selectedHours, setSelectedHours] = useState(0); - const [selectedMinutes, setSelectedMinutes] = useState(0); - const [endSelectedHours, setEndSelectedHours] = useState(0); - const [endSelectedMinutes, setEndSelectedMinutes] = useState(0); const [time, setTime] = useState(new Date()) - const [endTime, setEndTime] = useState(new Date()) + const idComunidad = user.community_id const date = new Date(); + const [mode, setMode] = useState('time'); useEffect(() => { @@ -36,7 +33,7 @@ export default function AreaComun({navigation}){ try { - const jsonResponse = await fetch(`${API.BASE_URL}/commonArea/allCommonAreas`, { + const jsonResponse = await fetch(`${API.BASE_URL}/commonArea/findByCommunity/` + `${idComunidad}`, { method: "GET", headers: { 'Content-Type': 'application/json' @@ -44,7 +41,7 @@ export default function AreaComun({navigation}){ }) const response = await jsonResponse.json(); - console.log(response.message); + // console.log(response.message); setAreas(response.message); @@ -102,16 +99,10 @@ export default function AreaComun({navigation}){ const onChangeStart = (event, selectedDate) => { - const currentDate = selectedDate; - setShow(false); + const currentDate = selectedDate || time; + setTime(currentDate); }; - const onChangeEnd = (event, selectedDate) => { - const currentDate = selectedDate; - setShow(false); - setEndTime(currentDate); - }; - return (
diff --git a/mobile-ui/components/Profile.js b/mobile-ui/components/Profile.js index b8904eff..baeb64ad 100644 --- a/mobile-ui/components/Profile.js +++ b/mobile-ui/components/Profile.js @@ -4,7 +4,7 @@ import { Box, Button, Center, FormControl, Heading, ScrollView, VStack } from "native-base"; -import { Dimensions, StyleSheet, TextInput, useWindowDimensions } from "react-native"; +import { StyleSheet, TextInput, useWindowDimensions } from "react-native"; import { UserContext } from "../context/UserContext"; import { createMaterialTopTabNavigator } from '@react-navigation/material-top-tabs'; import { stringMd5 } from 'react-native-quick-md5'; @@ -14,7 +14,7 @@ const { Navigator, Screen } = createMaterialTopTabNavigator(); export default function Profile({ navigation }) { - const baseURL = `${API.BASE_URL}/user/updateGuarda/` + const baseURL = `${API.BASE_URL}/user/updateUser/` const [index, setIndex] = useState(0); const layout = useWindowDimensions(); const userData = useContext(UserContext) @@ -22,6 +22,7 @@ export default function Profile({ navigation }) { const [apellido, setApellido] =useState(userData.user.last_name); const [email, setEmail] = useState(userData.user.email); const [password, setPassword] = useState(); + const [confirmPassword, setConfirmPassword] = useState() const id = userData.user._id; const decode = userData.Password; const [error, setError] = useState({}) @@ -132,7 +133,7 @@ export default function Profile({ navigation }) { Confirmar nueva contraseƱa - setPassword(value) }/> + setConfirmPassword(value) }/>