Skip to content

Commit

Permalink
use pipe delimiter for language filter on admin and public opportunit…
Browse files Browse the repository at this point in the history
…y pages (#740)
  • Loading branch information
jasondicker authored Apr 18, 2024
1 parent da0877e commit 5a2ddaf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/web/src/pages/admin/opportunities/[[...query]]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ const OpportunitiesAdmin: NextPageWithLayout<{
languages != undefined
? languages
?.toString()
.split(",")
.split("|") // use | delimiter as some languages contain ',' e.g (Catalan, Valencian)
.map((x) => {
const item = lookups_languages?.find((y) => y.name === x);
return item ? item?.id : "";
Expand Down Expand Up @@ -331,7 +331,7 @@ const OpportunitiesAdmin: NextPageWithLayout<{
? countries?.toString().split(",")
: null,
languages:
languages != undefined ? languages?.toString().split(",") : null,
languages != undefined ? languages?.toString().split("|") : null, // use | delimiter as some languages contain ',' e.g (Catalan, Valencian)
organizations:
organizations != undefined
? organizations?.toString().split(",")
Expand Down Expand Up @@ -467,7 +467,7 @@ const OpportunitiesAdmin: NextPageWithLayout<{
opportunitySearchFilter?.languages?.length !== undefined &&
opportunitySearchFilter.languages.length > 0
)
params.append("languages", opportunitySearchFilter.languages.join(","));
params.append("languages", opportunitySearchFilter.languages.join("|")); // use | delimiter as some languages contain ',' e.g (Catalan, Valencian)
if (
opportunitySearchFilter?.types?.length !== undefined &&
opportunitySearchFilter.types.length > 0
Expand Down
6 changes: 3 additions & 3 deletions src/web/src/pages/opportunities/[[...query]]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ const Opportunities: NextPageWithLayout<{
languages != undefined
? languages
?.toString()
.split(",")
.split("|") // use | delimiter as some languages contain ',' e.g (Catalan, Valencian)
.map((x) => {
const item = lookups_languages.find((y) => y.name === x);
return item ? item?.id : "";
Expand Down Expand Up @@ -398,7 +398,7 @@ const Opportunities: NextPageWithLayout<{
? countries?.toString().split(",")
: null,
languages:
languages != undefined ? languages?.toString().split(",") : null,
languages != undefined ? languages?.toString().split("|") : null, // use | delimiter as some languages contain ',' e.g (Catalan, Valencian)
organizations:
organizations != undefined
? organizations?.toString().split(",")
Expand Down Expand Up @@ -490,7 +490,7 @@ const Opportunities: NextPageWithLayout<{
opportunitySearchFilter?.languages?.length !== undefined &&
opportunitySearchFilter.languages.length > 0
)
params.append("languages", opportunitySearchFilter.languages.join(","));
params.append("languages", opportunitySearchFilter.languages.join("|")); // use | delimiter as some languages contain ',' e.g (Catalan, Valencian)
if (
opportunitySearchFilter?.types?.length !== undefined &&
opportunitySearchFilter.types.length > 0
Expand Down

0 comments on commit 5a2ddaf

Please sign in to comment.