[Vuejs]-Dict object to form data for patch operation in VueJS

0👍

It seems you are passing a string containing JSON to your server, instead of JSON data directly.

Probably you don’t need to create a FormData dict.
Can you not call editDetails directly with a data object instead of a dict?

Also, the data you are passing with postman is not formatted the same way. You may try the following:

const data = {
    user: {
        first_name: this.userDetails.first_name,
        last_name: this.userDetails.last_name,
        contact_number: this.$refs.contact_input.value,
        email: this.$refs.email_input.value
    },
    event_cost: this.$refs.event_cost.value,
    schedule: [
        {
            day_available: "TUE",
            time_available: "Morning"
        }
    ]
};

// call editDetails with this data object

Leave a comment