fix financial and certificates
This commit is contained in:
@@ -128,6 +128,23 @@ class InvoiceController extends BaseApiController
|
||||
]);
|
||||
}
|
||||
|
||||
public function preview(int $invoiceId): JsonResponse
|
||||
{
|
||||
$data = $this->pdfService->previewData($invoiceId);
|
||||
|
||||
if (isset($data['error'])) {
|
||||
return response()->json([
|
||||
'ok' => false,
|
||||
'message' => $data['error'],
|
||||
], 404);
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'ok' => true,
|
||||
...$data,
|
||||
]);
|
||||
}
|
||||
|
||||
public function pdf(int $invoiceId): StreamedResponse
|
||||
{
|
||||
$pdfBytes = $this->pdfService->buildPdf($invoiceId);
|
||||
|
||||
Reference in New Issue
Block a user