valdiacion reservas

This commit is contained in:
Maria Sanchez 2022-08-30 22:50:25 -06:00
parent b117491db9
commit 8d020cf055
2 changed files with 15 additions and 9 deletions

View File

@ -144,7 +144,7 @@ export default function AreaComun({navigation}){
<FormControl isRequired>
<FormControl.Label>Hora de inicio</FormControl.Label>
<View >
<DateTimePicker mode="datetime" is24Hour value={time} onChangeStart={onChangeStart}/>
<DateTimePicker minimumDate={date} mode="datetime" is24Hour value={time} onChangeStart={onChangeStart}/>
</View>
</FormControl>

View File

@ -15,13 +15,13 @@ const { Navigator, Screen } = createMaterialTopTabNavigator();
export default function Profile({ navigation }) {
const baseURL = `${API.BASE_URL}/user/updateUser/`
const [name, setName] = useState();
const [apellido, setApellido] =useState();
const [email, setEmail] = useState();
const [password, setPassword] = useState();
const [index, setIndex] = useState(0);
const layout = useWindowDimensions();
const userData = useContext(UserContext)
const [name, setName] = useState(userData.user.name);
const [apellido, setApellido] =useState(userData.user.last_name);
const [email, setEmail] = useState(userData.user.email);
const [password, setPassword] = useState();
const id = userData.user._id;
const decode = userData.Password;
const [error, setError] = useState({})
@ -37,6 +37,7 @@ export default function Profile({ navigation }) {
console.log(userData.user.password);
if (userData.user.password == dpassword) {
console.log(true);
setError({});
}else{
console.log(false);
setError({ ...error,
@ -179,9 +180,10 @@ export default function Profile({ navigation }) {
})
.then(response => {
console.log(baseURL+`${id}`);
// console.log(baseURL+`${id}`);
if (response.status != 201){
console.log('ocurrio un error ');
}else{
return response.json();
}
@ -206,8 +208,11 @@ export default function Profile({ navigation }) {
"status": userData.user.status,
"date_entry": userData.user.date_entry,
"community_id": userData.user.community_id,
"number_house": '20'
}
console.log(data);
try {
await fetch(baseURL+`${id}`, {
@ -221,9 +226,10 @@ export default function Profile({ navigation }) {
})
.then(response => {
console.log(baseURL+`${id}`);
//console.log(baseURL+`${id}`);
if (response.status != 201){
console.log('ocurrio un error ');
// console.log('ocurrio un error ');
console.log(response.json());
}else{
return response.json();
}