adding 'la suite territoriale' specific gaufre button/endpoint

This commit is contained in:
Emmanuel Pelletier
2024-05-02 12:58:24 +02:00
parent 001ca61773
commit c041c77360
9 changed files with 300 additions and 232 deletions

View File

@@ -66,11 +66,10 @@
iframe.width = "304"
iframe.height = "360"
iframe.style.cssText = "display: none !important"
const { host, protocol } = new URL(scriptTag.src)
const searchParams = new URLSearchParams(scriptTag.src)
const anct = searchParams.get("type") === "anct"
const { host, protocol, searchParams } = new URL(scriptTag.src)
const local = searchParams.get("type") === "local"
const lang = ["en"].includes(searchParams.get("lang")) ? searchParams.get("lang") : null
iframe.src = `${protocol}//${host}/api/v1/${(!!lang && `${lang}/`) || ""}gaufre${(!!anct && "?type=anct") || ""}`
iframe.src = `${protocol}//${host}/api/v1/${(!!lang && `${lang}/`) || ""}gaufre${(!!local && "/local") || ""}`
document.body.appendChild(iframe)
}