Commit baaa6ad9 authored by Emmanuel Raviart's avatar Emmanuel Raviart
Browse files

Rename API to search for series, studies & variables.

parent 4332995a
......@@ -58,7 +58,7 @@
} = query as ValidSearchQuery
switch (type) {
case "series": {
const [result, error] = await retrieveSeries(fetch, "/series", {
const [result, error] = await retrieveSeries(fetch, "/series/search", {
data_kind,
depositor,
distributor,
......@@ -100,28 +100,32 @@
break
}
case "studies": {
const [result, error] = await retrieveStudies(fetch, "/studies", {
data_kind,
depositor,
distributor,
first_year,
follow: [
Follow.Study_distributors,
Follow.Study_producers,
Follow.Study_topics,
],
keyword,
language: session.language,
last_year,
limit: 20,
nation,
offset,
producer,
q: term,
territory,
topic_class,
year,
})
const [result, error] = await retrieveStudies(
fetch,
"/studies/search",
{
data_kind,
depositor,
distributor,
first_year,
follow: [
Follow.Study_distributors,
Follow.Study_producers,
Follow.Study_topics,
],
keyword,
language: session.language,
last_year,
limit: 20,
nation,
offset,
producer,
q: term,
territory,
topic_class,
year,
},
)
if (error !== null) {
return {
error: new Error(
......@@ -140,24 +144,28 @@
break
}
case "variables": {
const [result, error] = await retrieveVariables(fetch, "/variables", {
data_kind,
depositor,
distributor,
first_year,
follow: [Follow.Variable_study],
keyword,
language: session.language,
last_year,
limit: 20,
nation,
offset,
producer,
q: term,
territory,
topic_class,
year,
})
const [result, error] = await retrieveVariables(
fetch,
"/variables/search",
{
data_kind,
depositor,
distributor,
first_year,
follow: [Follow.Variable_study],
keyword,
language: session.language,
last_year,
limit: 20,
nation,
offset,
producer,
q: term,
territory,
topic_class,
year,
},
)
if (error !== null) {
return {
error: new Error(
......@@ -623,7 +631,7 @@
/>
<!-- BUTTON RECHERCHE AVANCEE -->
<!--
<!--
<a class="mx-0 -mr-14 text-right text-xs text-red-400" href="/advanced"
>-- recherche avancée --</a
> -->
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment