I am using storage.post() method for Ajax call to get data and update the block. I am using below code:
var payload = {
form_key: window.FORM_KEY
};return storage.post(
ajaxUrl,
JSON.stringify(payload)
).done(
function (response) {
self.names(response.message);
}
);
But It gives following error while checking my Ajax request under console:
{“error”: true, “message”: “Invalid Form Key. Please refresh the page.”}