Skip to content

Commit 00fbf47

Browse files
committed
fixes for change to taxonomy endpoint
1 parent 14c95a0 commit 00fbf47

File tree

7 files changed

+9
-17
lines changed

7 files changed

+9
-17
lines changed

src/routes/(app)/app/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181

8282
<Card title="Local indicators" mode="featured">
8383
<p style:margin-bottom="28px">
84-
Explore {$page.data.taxonomyFlat.length} indicators, including
84+
Explore {$page.data.taxonomy.count} indicators, including
8585
<a
8686
href={resolve(`/app/indicators/gross-disposable-household-income-per-head`)}
8787
class="no-wrap">household income</a

src/routes/(app)/app/indicators/+page.js renamed to src/routes/(app)/app/+page.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ export const load = async ({ fetch }) => {
44
const path = resolve("/api/v1/metadata/taxonomy");
55
const taxonomy = await(await fetch(path)).json();
66

7-
const pathFlat = resolve("/api/v1/metadata/taxonomy?flat=true");
8-
const taxonomyFlat = await(await fetch(pathFlat)).json()
9-
107
return {
11-
taxonomy,
12-
taxonomyFlat
8+
taxonomy
139
};
1410
};

src/routes/(app)/app/indicators/+page.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
<Hero width="medium" title="Local indicators" cls="titleblock-transparent">
2626
<p class="ons-hero__text">
27-
Explore our {data.taxonomyFlat.length} local indicators, including
27+
Explore our {data.taxonomy.count} local indicators, including
2828
<b>disposable household income</b>,
2929
<b>participation in further education</b>
3030
and
@@ -41,7 +41,7 @@
4141
{/snippet}
4242

4343
<NavSections cls="nav-sections">
44-
{#each data.taxonomy as theme}
44+
{#each data.taxonomy.data as theme}
4545
<NavSection title={theme.label} id={theme.slug}>
4646
{#each theme.children as child}
4747
{#if child.description}

src/routes/(app)/app/+page.js renamed to src/routes/(app)/app/indicators/+page.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ export const load = async ({ fetch }) => {
44
const path = resolve("/api/v1/metadata/taxonomy");
55
const taxonomy = await(await fetch(path)).json();
66

7-
const pathFlat = resolve("/api/v1/metadata/taxonomy?flat=true");
8-
const taxonomyFlat = await(await fetch(pathFlat)).json()
9-
107
return {
11-
taxonomy,
12-
taxonomyFlat
8+
taxonomy
139
};
1410
};

src/routes/(demo)/indicator/+page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ export const load = async ({ fetch }) => {
77
const indicators = await(await fetch(path)).json();
88

99
return {
10-
indicators: indicators.filter(ind => !exclude.includes(ind.slug))
10+
indicators: indicators.data.filter(ind => !exclude.includes(ind.slug))
1111
};
1212
};

src/routes/(demo)/indicators/+page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ export const load = async ({ fetch }) => {
55
const taxonomy = await(await fetch(path)).json();
66

77
return {
8-
taxonomy
8+
taxonomy: taxonomy.data
99
};
1010
};

src/routes/(demo)/query/+page.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ export const load = async ({ fetch, url }) => {
1919
const areaList = await(await fetch(`/api/v1/geo/list`)).json();
2020
areaList.sort((a, b) => a.areanm.localeCompare(b.areanm));
2121

22-
const taxonomy = await (
22+
const taxonomy = (await (
2323
await fetch(resolve("/api/v1/metadata/taxonomy?flat=true"))
24-
).json();
24+
).json()).data;
2525

2626
const topics = Array.from(new Set(taxonomy.map((t) => t.topic))).map((t) => ({
2727
slug: t,

0 commit comments

Comments
 (0)