Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

280
Visualizações
How to set the values from EasyAdmin using Axios and javascript to fill the input?

I'm using ApiPLatform 3, Axios and EasyAdmin 3. In my form when I choose an institution, all the fields from Address are filled from the choosen institution.

This is how I did ins JS :

selectInstitution.addEventListener('change', () => {
    institutionId = selectInstitution.options[selectInstitution.selectedIndex].value;
    axios.get(`/api/institutions/${institutionId}`).then(response => {
        if (200 === response.status) {

            agendaStreet.value = response.data.address ? response.data.address.street : '';
            agendaComplementStreet.value = response.data.address ? response.data.address.complement : '';
            agendaZipcode.value = response.data.address ? response.data.address.city.zipCode : '';
            agendaCity.value = response.data.address ? response.data.address.city.name : '';
        }
    });
});

Everything work in front but when I submit I've got this error :

An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'institution_address' cannot be null.

And if I dump after the submit I can see my Entity Address to null. I don't figure out why symfony does not set the value.

Any idea ?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda