Skip to content

Commit 6ea0866

Browse files
committed
add fn to get latest match with notes
1 parent fb74fd2 commit 6ea0866

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/algora/matches/matches.ex

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,4 +287,15 @@ defmodule Algora.Matches do
287287
is_nil(match.company_bookmarked_at) &&
288288
DateTime.after?(match.inserted_at, one_week_ago)
289289
end
290+
291+
def get_latest_match_with_notes(user_id) do
292+
Repo.one(
293+
from(m in JobMatch,
294+
where: m.user_id == ^user_id,
295+
where: not is_nil(m.notes) and m.notes != "",
296+
order_by: [desc: m.updated_at],
297+
limit: 1
298+
)
299+
)
300+
end
290301
end

0 commit comments

Comments
 (0)