<?php


namespace Magetop\Advancepreview\Controller\Adminhtml\PreviewDiscount;


class Edit extends \Magetop\Advancepreview\Controller\Adminhtml\ProductPreview
{
    public function execute()
    {
        $response = [
            'status'=>'error',
            'html'=>''
        ];
        try {
            $response['html'] = $this->_view->getLayout()->createBlock('Magetop\Advancepreview\Block\Adminhtml\Product\Edit\PreviewDiscount')->setTemplate('Magetop_Advancepreview::product/discount/edit.phtml')->toHtml();
            $response['status'] = 'success';
        }
        catch (\Exception $exception) {
            $response['html'] = $exception->getMessage();
        }
        return $this->getAjaxResponse($response);
    }
}
