Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

146
Vistas
Vue - InertiaJS: Enter Object not able

In my props, I pass the array "ticket_data" when loading the Vue component. Now I want to make a post to a controller using the Inertia form. This also works without problems.

My problem is, I can not access individual values from the array ...

My code:

let props = defineProps({
    ticket_data: Object,
    ticket_messages: Object,
});

let form = useForm({
    text: '',
});

let submit = () => {

    form
    .transform((data) => ({
        data,
        ticket_id: props.ticket_data.ticket_id, // null
        ticket_id: props.ticket_data, // gives all Data see Json
    }))
    .post('/account/user/support/ticket/send', {
        preserveScroll: true,
        onSuccess: () => form.reset('text'),
    });
};

If I submit props.ticket_data individually, the following post arrives at my controller:

"ticket_id":[{"user_id":1,"ticket_id":5,"reference":"Testticket","state":0,"author":"Kevin Johnson","text":"..","created_at":"11/04/22 - 19:58"}]}

If the data arrives with "props.ticket_data", why can't I just access it with "props.ticket_data.ticket_id" ?

"props.ticket_data.[1]" doesn't work like that either....

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Get a ticket by Id like this:

props.ticket_data.find(ticket => ticket.ticket_id === 5) // <-- ticket id
about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda