Skip to content

Commit e881f8c

Browse files
committed
refactor: update job match sorting criteria to include regions
1 parent bfd63a8 commit e881f8c

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

lib/algora/matches/matches.ex

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,6 @@ defmodule Algora.Matches do
4141
def fetch_job_matches(job_posting_id) do
4242
job = Repo.get!(JobPosting, job_posting_id)
4343

44-
job_countries =
45-
job.regions
46-
|> Enum.flat_map(&Algora.PSP.ConnectCountries.get_countries/1)
47-
|> Enum.concat(job.countries)
48-
|> Enum.uniq()
49-
5044
existing_matches =
5145
Repo.all(
5246
from(m in JobMatch,
@@ -71,7 +65,7 @@ defmodule Algora.Matches do
7165
tech_stack: job.tech_stack,
7266
has_min_compensation: true,
7367
system_tags: job.system_tags,
74-
sort_by: [{"countries", job_countries}]
68+
sort_by: [{"countries", job.countries}, {"regions", job.regions}]
7569
]
7670
|> Algora.Cloud.list_top_matches()
7771
|> Algora.Settings.load_matches_2()

0 commit comments

Comments
 (0)