first commit

This commit is contained in:
2026-03-17 17:34:34 +01:00
commit 45fc1ff5c0
9 changed files with 358 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
export function buildURL(query) {
let url =
"https://data.enseignementsup-recherche.gouv.fr/api/explore/v2.1/catalog/datasets/fr-esr-parcoursup/records?limit=10"
if (query && query.trim() !== "") {
url += "&where=search(lib_for_voe_ins, '" + query + "')"
}
return url
}
export async function fetchFormations(query) {
const url = buildURL(query)
const response = await fetch(url)
if (!response.ok) {
throw new Error("Erreur HTTP")
}
return await response.json()
}