2
I have a Button
with a onPress
If I put this onPress
thus:
onPress={() => request.manifestacaoAnonima(
this.state.email,
this.state.selected,
this.state.manifesto,
this.state.tipomanifestacao,
this.state.tipopessoa,
this.state.latitude,
this.state.longitude,
this.state.endereco,
this.state.numero,
this.state.complemento,
this.state.bairro,
this.state.cidade
)}
It works sends the data to API, all right.
But if I try to call one more function in this very onPress
:
onPress={() => { request.manifestacaoAnonima(
this.state.email,
this.state.selected,
this.state.manifesto,
this.state.tipomanifestacao,
this.state.tipopessoa,
this.state.latitude,
this.state.longitude,
this.state.endereco,
this.state.numero,
this.state.complemento,
this.state.bairro,
this.state.cidade
), Actions.index() }
}
He executes the Actions.index()
correctly but returns me Request failed with status code 500
in the request
What could be the reason?
EDIT
The request
that this call comes from import request from './services/request';
Which has:
const request = {
let: dssenha = geraSenha(6),
manifestacaoAnonima: (
eeemailusuario,
local,
dstextomanifestacao,
idtipomanifestacao,
tipopessoa,
latitude,
longitude,
endereco,
numero,
complemento,
bairro,
cidade
) => {
axios.post('http://192.168.0.23/apiTeste/public/api/manifestacao?'
+'dssenha='+dssenha
+'&dstextomanifestacao='+dstextomanifestacao
+'&eeemailusuario='+eeemailusuario
+'&nmpessoa=Anônimo'
+'&nrpronac='+local
+'&tipopessoa='+tipopessoa
+'&idtipomanifestacao='+idtipomanifestacao
+'&latitude='+latitude
+'&longitude='+longitude
+'&enendereco='+endereco
+'&nrendereco='+numero
+'&dscomplemento='+complemento
+'&dsbairro='+bairro
+'&dslocalidade='+cidade
)
.then(response => {
console.log(response);
}).catch((error) => {
console.log(error.message)
});
},
};
export default request;
It performs the index correctly, as action is called page, and goes to ok page, it starts to return me the
500
no request, which if done alone will not result error– Mateus