passage du prototype en composant riot simple

This commit is contained in:
2026-03-18 12:45:44 +01:00
parent 45fc1ff5c0
commit f9b19326f8
4 changed files with 160 additions and 50 deletions
+19 -19
View File
@@ -1,21 +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
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 + "')"
}
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()
}
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()
}