@@ -142,7 +151,7 @@ const Cadastro: React.FC = () => {
setFirstName(e.target.value)}
+ onIonChange={(e: any) => setFirstName(e.target.value)}
>
@@ -150,7 +159,7 @@ const Cadastro: React.FC = () => {
Sobrenome
setLastName(e.target.value)}
+ onIonChange={(e: any) => setLastName(e.target.value)}
>
@@ -161,7 +170,7 @@ const Cadastro: React.FC = () => {
setEmail(e.target.value)}
+ onIonChange={(e: any) => setEmail(e.target.value)}
>
@@ -170,7 +179,7 @@ const Cadastro: React.FC = () => {
Data de nascimento
setBirthDate(e.target.value)}
+ onIonChange={(e: any) => setBirthDate(e.target.value)}
>
@@ -180,7 +189,7 @@ const Cadastro: React.FC = () => {
setPassword(e.target.value)}
+ onIonChange={(e: any) => setPassword(e.target.value)}
>
@@ -188,7 +197,7 @@ const Cadastro: React.FC = () => {
setConfirmPassword(e.target.value)}
+ onIonChange={(e: any) => setConfirmPassword(e.target.value)}
>
@@ -201,9 +210,9 @@ const Cadastro: React.FC = () => {
{/*
*/}
+
setShowToast(false)}
message={messageToast}
diff --git a/src/pages/CadastroCompletar.tsx b/src/pages/CadastroCompletar.tsx
deleted file mode 100644
index f1b6654..0000000
--- a/src/pages/CadastroCompletar.tsx
+++ /dev/null
@@ -1,149 +0,0 @@
-import {
-IonBackButton,
-IonButton,
-IonButtons,
-IonCard,
-IonCardContent,
-IonContent,
-IonHeader,
-IonIcon,
-IonItem,
-IonLabel,
-IonPage,
-IonTitle,
-IonToolbar
-} from "@ionic/react";
-import React, { useEffect, useReducer, useState } from "react";
-
-import './Perfil.css'
-import { useHistory, useLocation } from "react-router";
-import { bookOutline, callOutline, documentTextOutline, homeOutline, logoWhatsapp } from "ionicons/icons";
-
-import isEqual from 'lodash.isequal';
-
-import * as usersRoutes from '../services/api/users';
-
-import './Cadastro/Cadastro.css'
-
-interface userData {
- name: string;
- lastname: string;
- email: string;
- birth_date: string;
- bio: string;
-}
-
-interface LocationState {
- userData: userData
-}
-
-const items = [
- // TODO, CPF e CNH
- {
- icon: documentTextOutline,
- label: 'Documentos',
- description: 'Cadastre seus documentos para que seu perfil possa ser verificado.'
- },
- // TODO, telefone e WhatsApp
- {
- icon: callOutline,
- label: 'Informações de contato',
- description: 'Cadastre seu número de telefone celular que para possam contatar você.'
- },
- {
- icon: homeOutline,
- label: 'Endereço de residência',
- description: 'Diga-nos seu endereço para que possa começar a solicitar vagas.'
- },
- {
- icon: bookOutline,
- label: 'Instituição de ensino',
- description: 'Diga-nos sua IES para que possa começar a solicitar vagas.'
- },
-]
-
-const CadastroCompletar: React.FC = () => {
- const history = useHistory();
- const location = useLocation();
-
- const [showToast, setShowToast] = useState(false);
- const [messageToast, setMessageToast] = useState('');
-
- const [userData, setUserData] = useState({
- name: '',
- lastname: '',
- email: '',
- birth_date: '',
- bio: '',
- });
-
- const [inputValues, setInputValues] = useReducer(
- (state: any, newState: any) => ({ ...state, ...newState }),
- {
- name: '',
- lastname: '',
- email: '',
- birth_date: '',
- bio: '',
- }
- );
-
- useEffect(() => {
- let userData = location.state.userData
-
- setUserData(location.state.userData)
- setInputValues({
- 'name': userData.name,
- 'lastname': userData.lastname,
- 'email': userData.email,
- 'birth_date': userData.birth_date,
- 'bio': userData.bio
- });
- }, [userData]);
-
- const handleUpdateUserData = () => {
- usersRoutes.update(inputValues).then(response => {
- if (response.status === 'error') {
- setMessageToast(response.message);
- setShowToast(true);
-
- return
- }
-
- console.log(response)
- }).catch((err) => {
- setMessageToast(err);
- setShowToast(true);
- })
- }
-
- return (
-
-
-
- Completar cadastro
-
-
-
-
-
-
-
- { items.map((item, index) => {
- return (
-
-
-
- {item.label}
-
-
- {item.description}
-
- )
- })}
-
-
- );
-};
-
-export default CadastroCompletar;
diff --git a/src/pages/CadastroCompletar/CadastroCompletar.tsx b/src/pages/CadastroCompletar/CadastroCompletar.tsx
new file mode 100644
index 0000000..de2c677
--- /dev/null
+++ b/src/pages/CadastroCompletar/CadastroCompletar.tsx
@@ -0,0 +1,142 @@
+import {
+IonBackButton,
+IonButtons,
+IonCard,
+IonCardContent,
+IonContent,
+IonHeader,
+IonIcon,
+IonItem,
+IonLabel,
+IonPage,
+IonTitle,
+IonToast,
+IonToolbar
+} from "@ionic/react";
+import React, { useEffect, useReducer, useState } from "react";
+
+import '../Perfil.css'
+import { useHistory, useLocation } from "react-router";
+import { callOutline, documentTextOutline } from "ionicons/icons";
+
+import '../Cadastro/Cadastro.css'
+import { Color } from "@ionic/react/node_modules/@ionic/core";
+
+interface cardItem {
+ icon: string;
+ label: string;
+ description: string;
+ url: string;
+ required: boolean;
+}
+
+interface userData {
+ name: string;
+ lastname: string;
+ email: string;
+ phone_number: string;
+ birth_date: string;
+ bio: string;
+ document_type: string;
+ document: string;
+}
+
+interface LocationState {
+ userData: userData;
+
+ redirectData?: {
+ showToastMessage: boolean;
+ toastColor: Color;
+ toastMessage: string;
+ }
+}
+
+let items: cardItem[] = [
+ {
+ icon: documentTextOutline,
+ label: 'Documento',
+ description: 'Cadastre seu documento para que seu perfil possa ser verificado',
+ url: '/perfil/completar/documento',
+ required: false
+ },
+ {
+ icon: callOutline,
+ label: 'Informações de contato',
+ description: 'Cadastre seu número de telefone celular que para possam contatar você',
+ url: '/perfil/completar/telefone',
+ required: false
+ }
+]
+
+const CadastroCompletar: React.FC = () => {
+ const history = useHistory();
+ const location = useLocation();
+
+ const [showToast, setShowToast] = useState(false);
+ const [toastMessage, setToastMessage] = useState('');
+ const [toastColor, setToastColor] = useState("primary");
+
+ const handleCardClick = (item: cardItem) => {
+ if (!item.required) return
+
+ history.push({ pathname: item.url, state: { userData: location.state.userData } });
+ }
+
+ useEffect(() => {
+ if (!location.state || !location.state.userData) {
+ history.push({ pathname: '/perfil' })
+ }
+
+ if (location.state && location.state.redirectData) {
+ const redirectData = location.state.redirectData
+
+ if (redirectData.showToastMessage) {
+ setToastColor(redirectData.toastColor)
+ setToastMessage(redirectData.toastMessage)
+ setShowToast(true)
+ }
+ }
+
+ if (!location.state.userData.document) items[0].required = true
+ if (!location.state.userData.phone_number) items[1].required = true
+ }, []);
+
+ return (
+
+
+
+ Completar cadastro
+
+
+
+
+
+
+
+ { items.map((item, index) => {
+ return (
+ { handleCardClick(item) }}>
+
+
+ {item.label}
+
+
+ {item.description}
+
+ )
+ })}
+
+ setShowToast(false)}
+ message={toastMessage}
+ duration={2500}
+ />
+
+
+ );
+};
+
+export default CadastroCompletar;
diff --git a/src/pages/CadastroCompletar/CompletarDocumento.tsx b/src/pages/CadastroCompletar/CompletarDocumento.tsx
new file mode 100644
index 0000000..5fc9a8c
--- /dev/null
+++ b/src/pages/CadastroCompletar/CompletarDocumento.tsx
@@ -0,0 +1,219 @@
+import {
+ IonBackButton,
+ IonButtons,
+ IonContent,
+ IonFab,
+ IonFabButton,
+ IonHeader,
+ IonIcon,
+ IonList,
+ IonPage,
+ IonSelect,
+ IonSelectOption,
+ IonTitle,
+ IonToast,
+ IonToolbar
+} from "@ionic/react";
+import React, { useEffect, useState } from "react";
+import { IonGrid, IonRow, IonCol } from "@ionic/react";
+import { useHistory, useLocation } from "react-router-dom";
+import {
+ IonItem,
+ IonLabel,
+ IonInput,
+} from "@ionic/react";
+
+import { saveOutline } from "ionicons/icons";
+
+import * as usersRoutes from '../../services/api/users';
+
+import validateCpf from '../../services/validateCpf'
+
+interface documentTypesInterface {
+ label: string;
+ name: string;
+}
+
+interface userData {
+ name: string;
+ lastname: string;
+ email: string;
+ phone_number: string;
+ birth_date: string;
+ bio: string;
+ document_type: string;
+ document: string;
+}
+
+interface LocationState {
+ userData: userData;
+}
+
+const CompletarDocumento: React.FC = () => {
+ const location = useLocation();
+
+ const [hasChangedSinceInitialState, setHasChangedSinceInitialState] = useState(false);
+
+ const [documentTypes, setDocumentTypes] = useState([]);
+
+ const [document, setDocument] = useState('');
+ const [documentType, setDocumentType] = useState('');
+
+ const [documentMaxLength, setDocumentMaxLength] = useState(0);
+
+ const [showToast, setShowToast] = useState(false);
+ const [messageToast, setMessageToast] = useState('');
+
+ const history = useHistory();
+
+ const validateform = () => {
+ if (isNaN((Number)(document))) {
+ setMessageToast('Documento pode conter apenas números!')
+ setShowToast(true)
+ return false
+ }
+
+ if (documentType === 'cpf' && !validateCpf(document)) {
+ setMessageToast('CPF inválido!')
+ setShowToast(true)
+ return false
+ }
+
+ return true
+ }
+
+ const handleUpdateUserDocuments = async () => {
+ if (!validateform()) {
+ return
+ }
+
+ usersRoutes.update({ document_type: documentType, document: document }).then(response => {
+ if (response.status === 'error') {
+ setMessageToast(response.message);
+ setShowToast(true);
+
+ return
+ }
+
+ history.push({ pathname: '/perfil', state: {
+ redirectData: {
+ showToastMessage: true,
+ toastColor: "success",
+ toastMessage: response.message,
+ }
+ }})
+ }).catch((err) => {
+ setMessageToast(err);
+ setShowToast(true);
+ })
+ };
+
+ const handleChangeDocumentType = (document_type: string) => {
+ switch(document_type) {
+ case 'cpf':
+ setDocumentType('cpf') // workaround para o problema de setState para valores vindos de um evento sendo triggerado por um ion-select
+ setDocumentMaxLength(11)
+ break;
+ case 'cnh':
+ setDocumentType('cnh') // workaround para o problema de setState para valores vindos de um evento sendo triggerado por um ion-select
+ setDocumentMaxLength(11)
+ break;
+ case 'rg':
+ setDocumentType('rg') // workaround para o problema de setState para valores vindos de um evento sendo triggerado por um ion-select
+ setDocumentMaxLength(9)
+ break;
+ }
+ }
+
+ useEffect(() => {
+ if (!location.state.userData) {
+ history.push({ pathname: '/perfil', state: {
+ redirectData: {
+ showToastMessage: true,
+ toastColor: "warning",
+ toastMessage: "Houve um erro. Por favor, tente novamente.",
+ }, userData: location.state.userData
+ }})
+ }
+
+ setDocumentTypes([
+ {
+ name: 'cpf',
+ label: 'CPF',
+ },
+ {
+ name: 'rg',
+ label: 'RG',
+ },
+ {
+ name: 'cnh',
+ label: 'CNH',
+ },
+ ])
+ }, [])
+
+ return (
+
+
+
+ Completar cadastro
+
+
+
+
+
+
+
+
+
+ Completar cadastro
+
+
+
+
+
+
+
+
+ Tipo de documento
+ { handleChangeDocumentType(e.detail.value) } }>
+ { documentTypes ? documentTypes.map((document, index) => {
+ return ({document.label})
+ }) : <>> }
+
+
+
+ Documento
+ { setDocument(e.target.value); setHasChangedSinceInitialState(true) }}
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+ setShowToast(false)}
+ message={messageToast}
+ duration={2500}
+ />
+
+
+ );
+};
+
+export default CompletarDocumento;
+
\ No newline at end of file
diff --git a/src/pages/CadastroCompletar/CompletarTelefone.tsx b/src/pages/CadastroCompletar/CompletarTelefone.tsx
new file mode 100644
index 0000000..f739146
--- /dev/null
+++ b/src/pages/CadastroCompletar/CompletarTelefone.tsx
@@ -0,0 +1,169 @@
+import {
+ IonBackButton,
+ IonButtons,
+ IonContent,
+ IonFab,
+ IonFabButton,
+ IonHeader,
+ IonIcon,
+ IonList,
+ IonPage,
+ IonTitle,
+ IonToast,
+ IonToolbar
+} from "@ionic/react";
+import React, { useState, useEffect } from "react";
+import { IonGrid, IonRow, IonCol } from "@ionic/react";
+import { useHistory, useLocation } from "react-router-dom";
+import {
+ IonItem,
+ IonLabel,
+ IonInput,
+} from "@ionic/react";
+
+import { saveOutline } from "ionicons/icons";
+
+import * as usersRoutes from '../../services/api/users';
+import { Color } from "@ionic/react/node_modules/@ionic/core";
+
+interface documentTypesInterface {
+ label: string;
+ name: string;
+}
+
+interface userData {
+ name: string;
+ lastname: string;
+ email: string;
+ phone_number: string;
+ birth_date: string;
+ bio: string;
+ document_type: string;
+ document: string;
+}
+
+interface LocationState {
+ userData: userData;
+}
+
+const CompletarTelefone: React.FC = () => {
+ const location = useLocation();
+
+ const [hasChangedSinceInitialState, setHasChangedSinceInitialState] = useState(false);
+
+ const [phone, setPhone] = useState('');
+
+ const [showToast, setShowToast] = useState(false);
+ const [messageToast, setMessageToast] = useState('');
+ const [toastColor, setToastColor] = useState("primary");
+
+ const history = useHistory();
+
+ const validateform = () => {
+ if (isNaN((Number)(phone))) {
+ setMessageToast('O telefone pode conter apenas números!')
+ setShowToast(true)
+ return false
+ }
+
+ return true
+ }
+
+ const handleUpdateUserDocuments = async () => {
+ if (!validateform()) {
+ return
+ }
+
+ usersRoutes.update({ phone_number: phone }).then(response => {
+ if (response.status === 'error') {
+ setToastColor("warning")
+ setMessageToast(response.message);
+ setShowToast(true);
+
+ return
+ }
+
+ const userDataObj = location.state.userData
+
+ history.push({ pathname: '/perfil', state: {
+ redirectData: {
+ showToastMessage: true,
+ toastColor: "success",
+ toastMessage: response.message,
+ },
+ }})
+ }).catch((err) => {
+ setMessageToast(err);
+ setShowToast(true);
+ })
+ };
+
+ useEffect(() => {
+ if (!location.state.userData) {
+ history.push({ pathname: '/perfil', state: {
+ redirectData: {
+ showToastMessage: true,
+ toastColor: "warning",
+ toastMessage: "Houve um erro. Por favor, tente novamente.",
+ }
+ }})
+ }
+ }, [])
+
+ return (
+
+
+
+ Completar cadastro
+
+
+
+
+
+
+
+
+
+ Completar cadastro
+
+
+
+
+
+
+
+
+ Telefone
+ { setPhone(e.target.value); setHasChangedSinceInitialState(true) }}
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+ setShowToast(false)}
+ message={messageToast}
+ duration={2500}
+ />
+
+
+ );
+};
+
+export default CompletarTelefone;
+
\ No newline at end of file
diff --git a/src/pages/CadastroVan.tsx b/src/pages/CadastroVan.tsx
index 7862f9d..7091ce7 100644
--- a/src/pages/CadastroVan.tsx
+++ b/src/pages/CadastroVan.tsx
@@ -19,18 +19,23 @@ import {
} from "@ionic/react";
import React, { useEffect, useReducer, useState } from "react";
+import { useHistory } from "react-router-dom";
-import * as yup from 'yup';
-
-import { ApiClient } from "../services/api-client.service";
+// import * as yup from 'yup';
import carsService from '../services/functions/carsService'
+import * as vansRoutes from '../services/api/vans';
+
import "./CadastroVan.css";
+import { Color } from "@ionic/react/node_modules/@ionic/core";
const CadastroVan: React.FC = () => {
+ const history = useHistory();
+
const [showToast, setShowToast] = useState(false);
const [toastMessage, setToastMessage] = useState("");
+ const [toastColor, setToastColor] = useState("primary");
const [carModels, setCarModels] = useState([{
id_model: '',
@@ -43,77 +48,34 @@ const CadastroVan: React.FC = () => {
carPlate: '',
carBrand: '',
carModel: '',
- maxPassengers: 1,
- isRent: false,
- carRentalName: '',
- postalCode: '',
- street: '',
- number: '',
- complement: '',
- city: '',
- state: '',
+ seats_number: 1,
+ isRented: false,
+ locator_name: '',
+ locator_address: '',
+ locator_complement: '',
+ locator_city: '',
+ locator_state: '',
}
);
- // TODO, yup
- let schema = yup.object().shape({
- carPlate: yup.string().required(),
- carBrand: yup.string().required(),
- carModel: yup.string().required(),
- maxPassengers: yup.number().integer().min(1).max(100).required(),
- isRented: yup.boolean().required(),
- carRentalName: yup.string(), // .required(),
- postalCode: yup.string(), // .required(),
- street: yup.string(), // .required(),
- number: yup.number().integer(), // .required(),
- complement: yup.string(), // .required(),
- city: yup.string(), // .required(),
- state: yup.string(), // .required(),
-
- // name: yup.string().required(),
- // age: yup.number().required().positive().integer(),
- // email: yup.string().email(),
- // website: yup.string().url(),
- // createdOn: yup.date().default(function () {
- // return new Date();
- // }),
- });
-
- const vanForm = {
- carPlate: inputValues.carPlate,
- carBrand: inputValues.carBrand,
- carModel: inputValues.carModel,
- maxPassengers: inputValues.maxPassengers,
- isRented: inputValues.isRented,
- carRentalName: inputValues.carRentalName,
- carRentalAddress: {
- postalCode: inputValues.postalCode,
- street: inputValues.street,
- number: inputValues.number,
- complement: inputValues.complement,
- city: inputValues.city,
- state: inputValues.state,
- }
- };
-
const clearRentalData = () => {
setInputValues({
- carPlate: '',
- carBrand: '',
- carModel: '',
- maxPassengers: 1,
- isRent: false,
- carRentalName: '',
- postalCode: '',
- street: '',
- number: '',
- complement: '',
- city: '',
- state: '',
+ carRentalName: '',
+ complement: '',
+ city: '',
+ state: '',
})
};
const validateForm = (): boolean => {
+ const vanForm = {
+ carPlate: inputValues.carPlate,
+ carBrand: inputValues.carBrand,
+ carModel: inputValues.carModel,
+ seats_number: inputValues.seats_number,
+ isRented: inputValues.isRented,
+ };
+
if (
!vanForm.carPlate ||
vanForm.carPlate.length !== 7 ||
@@ -136,12 +98,18 @@ const CadastroVan: React.FC = () => {
return false;
}
- if (!vanForm.maxPassengers || !parseInt(`${vanForm.maxPassengers}`)) {
+ if (!vanForm.seats_number || !parseInt(`${vanForm.seats_number}`)) {
setToastMessage("Número de passageiros inválido");
setShowToast(true);
return false;
}
+ if ((Number)(vanForm.seats_number) < 1) {
+ setToastMessage("Número de passageiros deve ser positivo!");
+ setShowToast(true);
+ return false;
+ }
+
if (vanForm.isRented) {
return validateRentalForm();
} else {
@@ -152,43 +120,32 @@ const CadastroVan: React.FC = () => {
};
const validateRentalForm = (): boolean => {
- if (!vanForm.carRentalName) {
+ const locatorForm = {
+ locator_name: inputValues.locator_name,
+ locator_address: inputValues.locator_address,
+ locator_complement: inputValues.locator_complement,
+ locator_city: inputValues.locator_city,
+ locator_state: inputValues.locator_state,
+ }
+
+ if (!locatorForm.locator_name) {
setToastMessage("Nome do Locador é obrigatório");
setShowToast(true);
return false;
}
if (
- !vanForm.carRentalAddress.postalCode ||
- vanForm.carRentalAddress.postalCode.length !== 8 ||
- !vanForm.carRentalAddress.postalCode.match(/([0-9]){8}/g)
+ !locatorForm.locator_city ||
+ !locatorForm.locator_city.match(/([A-zà-úÀ-Ú])/g)
) {
- setToastMessage("Cep inválido");
+ setToastMessage("Cidade inválida");
setShowToast(true);
return false;
}
if (
- !vanForm.carRentalAddress.number ||
- !parseInt(`${vanForm.carRentalAddress.number}`)
- ) {
- setToastMessage("Número inválido");
- setShowToast(true);
- return false;
- }
-
- if (
- !vanForm.carRentalAddress.city ||
- !vanForm.carRentalAddress.city.match(/([A-zà-úÀ-Ú])/g)
- ) {
- setToastMessage("Cidade inválido");
- setShowToast(true);
- return false;
- }
-
- if (
- !vanForm.carRentalAddress.state ||
- !vanForm.carRentalAddress.state.match(/([A-zà-úÀ-Ú])/g)
+ !locatorForm.locator_state ||
+ !locatorForm.locator_state.match(/([A-zà-úÀ-Ú])/g)
) {
setToastMessage("Estado inválido");
setShowToast(true);
@@ -199,9 +156,41 @@ const CadastroVan: React.FC = () => {
};
const handleSubmit = async () => {
- if (validateForm()) {
- await ApiClient.doPost("/cadastro-van", vanForm);
+ if (!validateForm()) {
+ return
}
+
+ // cria registro da van
+ await vansRoutes.create({
+ plate: inputValues.carPlate,
+ brand: inputValues.carBrand,
+ model: inputValues.carModel,
+ seats_number: inputValues.seats_number,
+ locator_name: inputValues.locator_name,
+ locator_address: inputValues.locator_address,
+ locator_complement: inputValues.locator_complement,
+ locator_city: inputValues.locator_city,
+ locator_state: inputValues.locator_state
+ }).then(response => {
+ if (response.status === 'error') {
+ setToastMessage(response.message);
+ setShowToast(true);
+
+ return
+ }
+
+ history.push({ pathname: '/perfil', state: {
+ redirectData: {
+ showToastMessage: true,
+ toastColor: "success",
+ toastMessage: response.message,
+ },
+ }})
+ }).catch((err) => {
+ setToastColor("danger")
+ setToastMessage(err);
+ setShowToast(true);
+ })
};
useEffect(() => {
@@ -211,7 +200,9 @@ const CadastroVan: React.FC = () => {
const carModelsRes = await carsService.getAllCarModels()
if (carModelsRes.error) {
- console.log('Houve um erro')
+ setToastColor("danger")
+ setToastMessage(carModelsRes.error.errorMessage);
+ setShowToast(true);
return
}
@@ -248,24 +239,16 @@ const CadastroVan: React.FC = () => {
setInputValues({ carPlate: e.target.value })}
+ onIonChange={(e: any) => setInputValues({ carPlate: e.target.value })}
/>
- {/*
- Marca
- setInputValues({ carBrand: e.target.value })}
- />
- */}
-
+ {/* TODO, problema de setState para valores vindos de um evento sendo triggerado por um ion-select */}
Marca
-
+ { setInputValues({ carBrand: e.detail.value }) }}>
{ carModels ? carModels.map((carModel, index) => {
return ({carModel.name})
}) : <>> }
@@ -278,19 +261,20 @@ const CadastroVan: React.FC = () => {
type='text'
clearInput
placeholder='Digite o Modelo do Veículo'
- onIonInput={(e: any) => setInputValues({ carModel: e.target.value })}
+ onIonChange={(e: any) => setInputValues({ carModel: e.target.value })}
/>
- Número Máximo de Passageiros
+ Número de assentos
setInputValues({ maxPassengers: e.target.value })}
+ placeholder='podem ser ocupados por passageiros'
+ onIonChange={(e: any) => setInputValues({ seats_number: e.target.value })}
/>
@@ -313,38 +297,32 @@ const CadastroVan: React.FC = () => {
type='text'
clearInput
placeholder='Nome completo do Locador'
- onIonInput={(e: any) => setInputValues({ carRentalName: e.target.value })}
+ onIonChange={(e: any) => setInputValues({ locator_name: e.target.value })}
/>
setInputValues({ postalCode: e.target.value })}
- />
- setInputValues({ number: e.target.value })}
+ onIonChange={(e: any) => setInputValues({ locator_address: e.target.value })}
/>
setInputValues({ complement: e.target.value })}
+ onIonChange={(e: any) => setInputValues({ locator_complement: e.target.value })}
/>
setInputValues({ city: e.target.value })}
+ onIonChange={(e: any) => setInputValues({ locator_city: e.target.value })}
/>
setInputValues({ state: e.target.value })}
+ onIonChange={(e: any) => setInputValues({ locator_state: e.target.value })}
/>
@@ -362,12 +340,13 @@ const CadastroVan: React.FC = () => {