I want to call this controller through Ajax and have it return true or false. the methods all work correctly, however I get the error
Invalid return type C:\Sites\retracted\wwwroot\vendor\magento\framework\App\Bootstrap.php(258): Magento\Framework\App\Http->launch()
So I assume with extends Action I can't simply return a boolean - but what should it be to allow me to return a bool?
use \Magento\Framework\App\Action\Action;
class IsEmailRegistered extends Action implements \Magento\Framework\DataObject\IdentityInterface
{
...
public function execute()
{
$result = $this->voucherHelper->validateEmail($email);
return $result;
}
}