update fix deadcode, security
This commit is contained in:
@@ -325,22 +325,6 @@ class EmailTemplateController extends Controller
|
||||
->all();
|
||||
}
|
||||
|
||||
// ── Invoice PDF preview ───────────────────────────────────────────────────
|
||||
|
||||
public function previewInvoiceJson(int $id): JsonResponse
|
||||
{
|
||||
$template = Template::findOrFail($id);
|
||||
if ($template->scenario !== 'invoice_pdf' || $template->format !== 'json') {
|
||||
return response()->json(['error' => true, 'message' => 'Template này không phải invoice JSON.'], 422);
|
||||
}
|
||||
|
||||
$config = json_decode($template->message ?? '{}', true);
|
||||
// Return the config + blade HTML preview
|
||||
$html = view('pdf.invoice-preview', compact('config'))->render();
|
||||
|
||||
return response()->json(['error' => false, 'html' => $html]);
|
||||
}
|
||||
|
||||
// ── Helpers ───────────────────────────────────────────────────────────────
|
||||
|
||||
private function format(Template $t): array
|
||||
|
||||
Reference in New Issue
Block a user