Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UHF-9569: servicemap api changes #929

Merged
merged 2 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/js/health-station-search.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/maternity-and-child-health-clinic-search.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/school-search.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const AppSettings = {
index: 'health_stations',
locationsBaseUrl: 'https://api.hel.fi/servicemap/v2/administrative_division/?municipality=helsinki&type=health_station_district&unit_include=id',
locationsBaseUrl: 'https://api.hel.fi/servicemap/v2/administrative_division/?municipality=helsinki&type=health_station_district',
size: 15
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import configurationsAtom from '../store';
import getQueryString from '../helpers/ProximityQuery';
import AppSettings from '../enum/AppSettings';

type Unit = {
id?: number
type Result = {
units?: number[]
};

const UseProximityQuery = (params: SearchParams) => {
Expand Down Expand Up @@ -45,7 +45,7 @@ const UseProximityQuery = (params: SearchParams) => {
return null;
}

ids = locationsData.results.map((result: { unit: Unit }) => result.unit.id);
ids = locationsData.results.flatMap((result: Result) => result.units ?? []);
}

return fetch(`${baseUrl}/${index}/_search`, {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const AppSettings = {
index: 'maternity_and_child_health_clinic',
locationsBaseUrl: 'https://api.hel.fi/servicemap/v2/administrative_division/?municipality=helsinki&type=maternity_clinic_district&unit_include=id',
locationsBaseUrl: 'https://api.hel.fi/servicemap/v2/administrative_division/?municipality=helsinki&type=maternity_clinic_district',
size: 15
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import configurationsAtom from '../store';
import getQueryString from '../helpers/ProximityQuery';
import AppSettings from '../enum/AppSettings';

type Unit = {
id?: number
type Result = {
units?: number[]
};

const UseProximityQuery = (params: SearchParams) => {
Expand Down Expand Up @@ -45,7 +45,7 @@ const UseProximityQuery = (params: SearchParams) => {
return null;
}

ids = locationsData.results.map((result: { unit: Unit }) => result.unit.id);
ids = locationsData.results.flatMap((result: Result) => result.units ?? []);
}

return fetch(`${baseUrl}/${index}/_search`, {
Expand Down
2 changes: 1 addition & 1 deletion src/js/react/apps/school-search/enum/AppSettings.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const AppSettings = {
index: 'schools',
locationsBaseUrl: 'https://api.hel.fi/servicemap/v2/administrative_division/?municipality=helsinki&unit_include=id&type=lower_comprehensive_school_district_fi,lower_comprehensive_school_district_sv,upper_comprehensive_school_district_fi,upper_comprehensive_school_district_sv',
locationsBaseUrl: 'https://api.hel.fi/servicemap/v2/administrative_division/?municipality=helsinki&type=lower_comprehensive_school_district_fi,lower_comprehensive_school_district_sv,upper_comprehensive_school_district_fi,upper_comprehensive_school_district_sv',
size: 15
};

Expand Down
6 changes: 3 additions & 3 deletions src/js/react/apps/school-search/hooks/UseProximityQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import configurationsAtom from '../store';
import getQueryString from '../helpers/ProximityQuery';
import AppSettings from '../enum/AppSettings';

type Unit = {
id?: number
type Result = {
units?: number[]
};

const UseProximityQuery = (params: SearchParams) => {
Expand Down Expand Up @@ -45,7 +45,7 @@ const UseProximityQuery = (params: SearchParams) => {
return null;
}

ids = locationsData.results.map((result: { unit: Unit }) => result.unit.id);
ids = locationsData.results.flatMap((result: Result) => result.units ?? []);
}

return fetch(`${baseUrl}/${index}/_search`, {
Expand Down
Loading