[Fixed]-Error while updating the content

1👍

You should try changing your AJAX call this way:

$.ajax({
    url:'/api/v1/rental/'+this.props.data.slug+'/',
    type:'put',
    contentType: "application/json",
    data:JSON.stringify(newUser),
      success: (data) => {
        console.log('data',data);
      },
      error: (xhr, status, err) => {
        console.error(xhr, status, err.toString());
      }
    });

Your backend might be able to deserialize the data this way, as application/x-www-form-urlencoded does not seem to work.

👤Mijamo

Leave a comment