I am trying to submit the entire form data using the submit action in AEM forms. I have my own custom submit action which is built on top of the OOTB "sumit to REST endpoint" action. So I am able to hit the end point which I configured within the submit action but I am unable to read the response back to UI. I dont want to redirect it to another thank you page. My app is a single page application so I just want to write the response back to UI so that I can read the response. I have gone through the adobe docs and my code is below:
guideBridge.registerConfig("submitConfig", {"useAjax" : true});
guideBridge.submit({
validate: false,
error : function (guideResultObject) {console.log("error occured");},
success : function (guideResultObject) {console.log("success occured");
}
});
But I am unable to read the response the end point is writing back to my custom action. All I see in the "guideResultObject" is
"{"thankYouOption":"page","thankYouContent":"<currentpageUrl>/jcr:content/guideContainer.guideThankYouPage.html?owner=admin&status=Submitted"}", status: "Submitted"}
I think there are some internal GuideSubmitServlet scripts which are intercepting the request and adding these params to the response. Is there a way to stop this and send the my custom response back to UI ?
Thanks in advance.