fix : correction de l'impression des absences + ajout d'un favicon
All checks were successful
Auto Tag Develop / tag (push) Successful in 5s

This commit is contained in:
2026-02-09 20:49:47 +01:00
parent 92d5fa55d0
commit 5be33abb03
6 changed files with 22 additions and 11 deletions

View File

@@ -4,16 +4,17 @@ export const usePdfPrinter = () => {
const api = useApi()
const printPdf = async (url: string): Promise<void> => {
const blob = await api.getBlob(url);
const res = await api.getBlob(url);
const disposition = res.headers.get('content-disposition') || '';
const match = disposition.match(/filename="(.+?)"/i);
const filename = match?.[1] ?? 'document.pdf';
const pdfBlob = blob.type === 'application/pdf'
? blob
: new Blob([blob], { type: 'application/pdf' });
const pdfBlob = res.data.type === 'application/pdf'
? res.data
: new Blob([res.data], { type: 'application/pdf' });
const blobUrl = URL.createObjectURL(pdfBlob);
const filename = `test.pdf`;
const a = document.createElement('a');
a.href = blobUrl;
a.download = filename;