Correction PDF
This commit is contained in:
@@ -55,6 +55,22 @@
|
||||
|
||||
})(jQuery); // End of use strict
|
||||
|
||||
async function openRecipePdfById(id, initialUrl) {
|
||||
let pdfUrl = initialUrl || '';
|
||||
if (!pdfUrl) {
|
||||
try {
|
||||
const res = await fetch(`/HelloFresh/GetRecipesDetails?ids=${encodeURIComponent(id)}`);
|
||||
if (res.ok) {
|
||||
const arr = await res.json();
|
||||
pdfUrl = (arr?.[0]?.pdf || arr?.[0]?.Pdf || '');
|
||||
}
|
||||
} catch { /* ignore */ }
|
||||
}
|
||||
if (!pdfUrl) { alert("Aucun PDF pour cette recette."); return; }
|
||||
const proxied = `/HelloFresh/ProxyPdf?url=${encodeURIComponent(pdfUrl)}`;
|
||||
showPdfModal(proxied);
|
||||
}
|
||||
|
||||
/**
|
||||
* 💶 Formate un nombre en chaîne de caractères au format français avec division par 1000.
|
||||
* Exemples :
|
||||
|
||||
Reference in New Issue
Block a user