Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Calculadora

0

49
Vistas
Axios object as params not readable by backend

I have a problem with my axios query:

apiClient.get('http://localhost:8080/api/internalLocations/search', {
      params: {
        locationTypeCode: 'BIN_LOCATION',
        offset: '0',
        max: '5',
        parentLocation: {
          id: `${this.props.currentLocation}`,
        },
      },
    })

The query needs to be typeof ?[...]offset=5&parentLocation.id=xyz, but now it is like this: &offset=0&max=5&parentLocation={"id":"[object Object]"} and the backend doesn't know how to handle that. Is there any possibility to make it parentLocation.id=xyz?

7 months ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Try this, it should work

apiClient.get('http://localhost:8080/api/internalLocations/search', {
      params: {
        locationTypeCode: 'BIN_LOCATION',
        offset: '0',
        max: '5',
        'parentLocation.id': `${this.props.currentLocation}`,
      },
    })
7 months ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar empleo Planes Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.