fix: export SharePoint - erreur remontée au frontend, meilleur parsing URL et détection bibliothèque
This commit is contained in:
@@ -261,9 +261,14 @@ export default function InvoicesBAP() {
|
||||
if (data.invoiceId && data.pdfUrl) {
|
||||
setBapPdfUrls(prev => ({ ...prev, [data.invoiceId as number]: data.pdfUrl as string }));
|
||||
}
|
||||
if (data.exportMode === 'browser' && data.pdfUrl) {
|
||||
// Afficher l'erreur SharePoint si présente
|
||||
if ((data as any).sharepointUploadStatus === 'error') {
|
||||
toast.error(`Erreur export SharePoint : ${(data as any).sharepointUploadError || 'Erreur inconnue'}`, { duration: 8000 });
|
||||
} else if (data.exportMode === 'browser' && data.pdfUrl) {
|
||||
toast.success("Facture validée BAP ! Ouverture du PDF annoté...", { duration: 3000 });
|
||||
window.open(data.pdfUrl, '_blank');
|
||||
} else if ((data as any).sharepointUploadStatus === 'success' && (data as any).sharepointUploadPath) {
|
||||
toast.success(`Facture validée BAP ! PDF déposé dans SharePoint`, { duration: 6000 });
|
||||
} else if (data.exportMode === 'folder' && data.exportPath) {
|
||||
toast.success(`Facture validée BAP ! PDF enregistré dans : ${data.exportPath}`, { duration: 6000 });
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user