Skip to content

Empty 'data' Object on FormData use #4

Closed
@itsalb3rt

Description

@itsalb3rt

When I try to use formData and the status changes online, the request goes with the empty object "data";

//the eRequests localStorage data

[{method: "post", url: "http://localhost/gibucket/forms/submit_form_data", data: {}}]
0: {method: "post", url: "http://localhost/gibucket/forms/submit_form_data", data: {}}
data: {}
method: "post"
url: "http://localhost/gibucket/forms/submit_form_data"

My javascript code

var data = new FormData();
data.append('form_name', this.form_name);
data.append('form_data', JSON.stringify(form_data));
var req = new Request();

req.send({
    method: 'post',
    url: route.route,
    data: data,
}).then(response => {
    console.log(response.data);

}).catch(function (error) {
    console.log(error);
});

when online this works perfect so the code is fine. what is not right is that the data object is stored empty in the localstorage

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions