Skip to content

Commit

Permalink
Make keyword check case-insensitive for 'kuuluvuuskartta'
Browse files Browse the repository at this point in the history
  • Loading branch information
japauliina committed Nov 27, 2024
1 parent b55bfb5 commit f04f7c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/dataFetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export const fetchSelectedUnitData = (req, res, next) => {
}
data.complete = true;
store.dispatch(changeSelectedUnit(data));
if (data.keywords.fi?.includes('kuuluvuuskartta')) {
if (data.keywords.fi?.some(keyword => keyword.toLowerCase() === 'kuuluvuuskartta')) {
const hearingMapAPI = new HearingMapAPI();
const {
fetchSuccess, fetchError,
Expand Down
2 changes: 1 addition & 1 deletion src/views/UnitView/UnitView.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const UnitView = (props) => {
if (!stateUnit || !checkCorrectUnit(stateUnit) || !stateUnit.complete) {
fetchSelectedUnit(unitId, (unit) => {
setUnit(unit);
if (unit?.keywords?.fi?.includes('kuuluvuuskartta')) {
if (unit?.keywords?.fi?.some(keyword => keyword.toLowerCase() === 'kuuluvuuskartta')) {
fetchHearingMaps(unitId);
}
});
Expand Down

0 comments on commit f04f7c8

Please sign in to comment.