This scenario is for Formio platform. Once the formio form is submitted, I want to update the column in the formio using partial update. Postman request for Partial update -> https://documenter.getpostman.com/view/684631/formio-api/2Jvuks#17612070-b85b-427a-8f41-ce45c46d5865
When i try to run the code then I am getting error. Kindly let me know why error is coming and how to resolve it.
let submID = submission2._id;
console.log('Sub id is', submID);
var product_title = localStorage.getItem("recom");
var settings = {
"url": "https://foms.abc.com/user/login",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/json"
},
"data": JSON.stringify({
"data": {
"email": "abc@test.in",
"password": "Test123"
}}),
success: function(data, status, req){
console.log(req.getResponseHeader("x-jwt-token"))
var JWTToken = req.getResponseHeader("x-jwt-token");
console.log('token is', JWTToken);
}
};
// $.ajax(settings);
$.ajax(settings).done(function (data, status, req) {
var JWTToken = req.getResponseHeader("x-jwt-token");
console.log('token outside is', JWTToken);
var settings1 = {
"url": "https://foms.abc.com/form2/submission/submID",
"method": "PATCH",
"timeout": 0,
"headers": {
"x-jwt-token": JWTToken,
"Content-Type": "application/json"
},
"data": JSON.stringify([
{
"op": "replace",
"path": "/form2/page1Recommended",
"value": product_title
}
]),
};
$.ajax(settings1).done(function (response) {
console.log('change in data', response);
});
});
Error [1]: https://i.stack.imgur.com/ZPWLT.png