[FEAT] Full function and deployed version

This commit is contained in:
NADAL Jean-Baptiste
2026-02-19 15:15:58 +01:00
parent e7c4768589
commit cf0db69f2d
24 changed files with 6949 additions and 69 deletions

View File

@@ -3,7 +3,7 @@
import * as pdfjsLib from 'pdfjs-dist';
import { api } from '$lib/api';
pdfjsLib.GlobalWorkerOptions.workerSrc = '/pdf.worker.min.mjs';
pdfjsLib.GlobalWorkerOptions.workerSrc = '/pdf.worker.min.js';
interface Props {
pdfUrl: string;
@@ -34,9 +34,9 @@
loading = true;
error = '';
try {
// Load PDF via axios to include auth token
const path = pdfUrl.split('/download/')[1];
const response = await api.get(`/download/${path}`, {
// pdfUrl already contains the full URL with token
// Use it directly with axios
const response = await api.get(pdfUrl, {
responseType: 'blob'
});
const blob = new Blob([response.data], { type: 'application/pdf' });