Skip to content

Commit 604b905

Browse files
authored
Merge pull request #2384 from harnish7576/harnish7576/issue2381_uk_constituency_outputs_incorrectly_displayed_for_url
Ensures uk parliament constituencies only show-up when explicitly enabled
2 parents f8d5220 + dc423fd commit 604b905

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

src/pages/policy/output/tree.js

+5-11
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,11 @@ export const policyOutputs = {
4545
};
4646

4747
export function getPolicyOutputTree(countryId, searchParams = {}) {
48-
// Helper to safely check if a URL parameter exists
49-
const hasParam = (param) => {
50-
if (!searchParams) return false;
51-
if (typeof searchParams.get === "function") {
52-
return !!searchParams.get(param);
53-
}
54-
return !!searchParams[param];
55-
};
56-
const uk_local_areas_beta = hasParam("uk_local_areas_beta")
57-
? searchParams.get("uk_local_areas_beta")
58-
: false;
48+
// Checks if UK local areas is explicitly enabled in the URl Parameter
49+
const uk_local_areas_beta =
50+
searchParams && typeof searchParams.get === "function"
51+
? searchParams.get("uk_local_areas_beta") === "true"
52+
: false;
5953

6054
const tree = [
6155
{

0 commit comments

Comments
 (0)