URGENT: Error: Unable to handle the request. Contact the site administrator or view site monitoring logs for more information.

@yisrael-wix

Here my page code:

export function submitButton_click(event) {
  $w('#errorMessage').hide
console.log("Submit button was clicked")
 var swear_words_arr=new Array("badword1","badword2","badword3", "badword4");
 var regex = new RegExp('\\b(' + swear_words_arr.join('|') + ')\\b', 'i' );
 var text = $w('#textBox1').value;
 
 if(regex.test(text)) {
          $w('#errorMessage').text = "ERROR: Please make sure your review has no profane, racist or homophobic text, then try again"
          $w('#errorMessage').show();
          console.log("ERROR: Please make sure your review has no profane, racist or homophobic text, then try again")
            $w('#textBox1').focus();
 return false;
 // This part is working fine, it is just below this that is not working good
        } else {
 let rememberMe = local.getItem("rememberMe")
 if (rememberMe === "true") {
 var _id = local.getItem("_id");
 var username = local.getItem("username");
       } else {
 var username = session.getItem("username");
 var _id = session.getItem("_id");
 var usernameURL = "/members/update/" + _id
       }
 let submitRequestData = {
 "token": ("#captcha").token,
 "data": {
 "review": $w("#textBox1").value,
 "starRating": $w("#text136").text,
 "restaurantName": $w("#text151").text,
 "personName": username,
 "usernameURL": usernameURL
      }
    }
          processSubmission(submitRequestData)
      .then( () => {
        $w("#captcha").reset();
        $w("#submitButton").disable();
        $w("#errorMessage").text = "Review successfully submitted!";
        $w("#errorMessage").show();
      })
      .catch( (err) => {
 var errorMsg = err.message;
 var errCode = err.code;
        console.log(errorMsg)
        console.log(errCode)
        $w("#captcha").reset();
        $w("#submitButton").disable();
        $w("#errorMessage").text = "Something went wrong. Please redo the captcha challenge.";
        // I am getting this error in the text element
        $w("#errorMessage").show();
      })
          console.log("That review is not profane");
        }
}

Backend code:

import wixCaptcha from 'wix-captcha-backend';
import wixData from 'wix-data';

export function processSubmission(submitRequestData) {
 return wixCaptcha.authorize(submitRequestData.token)
    .then(() => {
 return wixData.insert("Reviews", submitRequestData.data);
    });
}


And here’s what my collection looks like:

All the field ID’s match the code

Thanks,
Alex