Skip to content

Commit afc9be0

Browse files
committed
split into new/recent
1 parent 76ce2cb commit afc9be0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/algora/matches/matches.ex

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,11 +281,15 @@ defmodule Algora.Matches do
281281
Check if a match is considered "new" (within the last 7 days and not yet approved/bookmarked by company).
282282
"""
283283
def is_match_new?(match) do
284-
one_week_ago = DateTime.add(DateTime.utc_now(), -7, :day)
285-
286284
is_nil(match.company_approved_at) &&
287285
is_nil(match.company_bookmarked_at) &&
288-
DateTime.after?(match.inserted_at, one_week_ago)
286+
is_match_recent?(match)
287+
end
288+
289+
def is_match_recent?(match) do
290+
one_week_ago = DateTime.add(DateTime.utc_now(), -7, :day)
291+
292+
DateTime.after?(match.inserted_at, one_week_ago)
289293
end
290294

291295
def get_latest_match_with_notes(user_id) do

0 commit comments

Comments
 (0)