Skip to content
Snippets Groups Projects
Commit b5765677 authored by DANIEL Ludovic's avatar DANIEL Ludovic
Browse files

Migrate to new API endpoint tabular-api.data.gouv.fr

parent 850a2f82
No related branches found
No related tags found
1 merge request!7Migrate to new API endpoint tabular-api.data.gouv.fr
Pipeline #230637 passed
......@@ -186,27 +186,23 @@ function configuregrantNumber() {
$.when(
// https://www.data.gouv.fr/fr/datasets/anr-01-projets-anr-dos-detail-des-projets-et-des-partenaires/
$.ajax({
url: "https://csvapi.data.gouv.fr/api/81e1cbaab6bb453fa469af5b7aa897a4",
url: "https://tabular-api.data.gouv.fr/api/resources/87d29a24-392e-4a29-a009-83eddcff3e66/data/",
data: {
_shape: "objects",
_rowid: "hide",
_size: numberOfResults,
_offset: "0",
_sort: "Projet.Code_Decision_ANR",
"Projet.Code_Decision_ANR__contains": params.data.term
page_size: numberOfResults,
page: 1,
"\"Projet.Code_Decision_ANR\"": "asc",
"\"Projet.Code_Decision_ANR\"__contains": params.data.term
},
dataType: "json"
}),
// https://www.data.gouv.fr/fr/datasets/anr-02-projets-anr-dgpie-detail-des-projets-et-des-partenaires/
$.ajax({
url: "https://csvapi.data.gouv.fr/api/73a46efeffd7a811a841e5a5f6ea53a0",
url: "https://tabular-api.data.gouv.fr/api/resources/aca6972b-577c-496a-aa26-009f81256dcb/data/",
data: {
_shape: "objects",
_rowid: "hide",
_size: numberOfResults,
_offset: "0",
_sort: "Projet.Code_Decision_ANR",
"Projet.Code_Decision_ANR__contains": params.data.term
page_size: numberOfResults,
page: 1,
"\"Projet.Code_Decision_ANR\"": "asc",
"\"Projet.Code_Decision_ANR\"__contains": params.data.term
},
dataType: "json"
})
......@@ -214,7 +210,7 @@ function configuregrantNumber() {
console.debug(anr_dos, anr_dgpie);
let result = anr_dos[0].rows.map(function(elem) {
let result = anr_dos[0].data.map(function(elem) {
return {
acronyme: elem["Projet.Acronyme"],
id: elem["Projet.Code_Decision_ANR"],
......@@ -222,7 +218,7 @@ function configuregrantNumber() {
titre_en: elem["Projet.Titre.Anglais"],
}
});
result = result.concat(anr_dgpie[0].rows.map(function(elem) {
result = result.concat(anr_dgpie[0].data.map(function(elem) {
return {
acronyme: elem["Projet.Acronyme"],
id: elem["Projet.Code_Decision_ANR"],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment