public function unlinkAction($id, $viewReference)
    {
        $view = $this->getViewByReferenceId($viewReference);

        try {
            $this->get('victoire_widget.widget_helper')->deleteById($id);
            $this->get('doctrine.orm.entity_manager')->flush();

            if ($view instanceof Template) {
                $redirect = $this->generateUrl('victoire_template_show', ['id' => $view->getId()]);
            } elseif ($view instanceof BusinessTemplate) {
                $redirect = $this->generateUrl('victoire_business_template_show', ['id' => $view->getId()]);
            } else {
                $viewReference = $this->get('victoire_view_reference.repository')
                    ->getOneReferenceByParameters(['viewId' => $view->getId()]);

                $redirect = $this->generateUrl('victoire_core_page_show', [
                        'url' => $viewReference->getUrl(),
                    ]);
            }

            return new JsonResponse([
                    'success'  => true,
                    'redirect' => $redirect,
                ]);
        } catch (Exception $ex) {
            return $this->getJsonReponseFromException($ex);
        }
    }