Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

161
Views
Patching the Formio database using Patch request gives error

I am submitting the data in Form.io but there is PdtName(Local storage value) which is shown after Form.io form is submitted. To pass PdtName value in Form.io database I am using patch request and passing the PdtName value to Form.io

let submID = submission2._id;
              console.log('Sub id is', submID);
              var product_title = localStorage.getItem("PdtName");
              var settings = {
                "url": "https://foms.abc.com/user/login",
                "method": "POST",
                "timeout": 0,
                "headers": {
                  "Content-Type": "application/json"
                },
                "data": JSON.stringify({
                  "data": {
                    "email": "tes@abc.in",
                    "password": "Test#123"
                  }}),
                  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/form/submission/submID",
              "method": "PATCH",
              "timeout": 0,
              "headers": {
                "x-jwt-token": JWTToken,
                "Content-Type": "application/json"
              },
              "data": JSON.stringify([
                {
                  "op": "replace",
                  "path": "/form/page1RecommendedProduct",
                  "value": product_title
                }
              ]),
            };

            $.ajax(settings1).done(function (response) {
              console.log('change', response);
            });
            });
            
//             console.log('Token is outside', JWTToken);
            console.log("product is", product_title);

enter image description here

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!