Skip to content

vt7.1 Vtiger_Response of result:true or result:false gives different data structure responses

We created a new Action for a module that sends a VTiger_Response of {success:true, result:true} OR {success:true, result:false}

We trigger the AJAX call using app.request.post({data:formData}).then(function(err,data){... processing of response..}

When inspecting the data variable after receiving the response, if the result was true, then data = true - however if result is false then data = {success:true, result:false}

We have traced this back to being due to the check in /layouts/v7/resources/application.js line 43,

} else if (data['result']) {

surely this should be a typesafe check e.g.

e.g. } else if (data['result'] !== null) {