Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions lib/algora/cloud.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
defmodule Algora.Cloud do
@moduledoc false

alias Algora.Repo
alias Algora.Accounts.User
alias Algora.Matches.JobMatch

def top_contributions(github_handles) do
call(AlgoraCloud, :top_contributions, [github_handles], [])
end
Expand Down Expand Up @@ -46,9 +50,18 @@ defmodule Algora.Cloud do
end

def notify_match(attrs) do
# call(AlgoraCloud.Talent.Jobs.SendJobMatchEmail, :send, [attrs])
match = Algora.Repo.get_by(Algora.Matches.JobMatch, user_id: attrs.user_id, job_posting_id: attrs.job_posting_id)
call(AlgoraCloud.EmailScheduler, :schedule_email, [:job_drip, match.id], {:ok, :skipped})
match = Repo.get_by(JobMatch, user_id: attrs.user_id, job_posting_id: attrs.job_posting_id)

if match && !user_opted_out?(match.user_id) do
call(AlgoraCloud.EmailScheduler, :schedule_email, [:job_drip, match.id], {:ok, :skipped})
else
{:ok, :skipped}
end
end

defp user_opted_out?(user_id) do
user = Repo.get(User, user_id)
user && user.opt_out_algora
end

def notify_candidate_like(_attrs) do
Expand Down
2 changes: 2 additions & 0 deletions lib/algora_web/live/org/bounties_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ defmodule AlgoraWeb.Org.BountiesLive do
<td class="[&:has([role=checkbox])]:pr-0 p-4 align-middle">
<div class="flex items-center justify-end gap-2">
<.button
:if={@current_user_role in [:admin, :mod]}
phx-click="edit-bounty-amount"
phx-value-id={bounty.id}
variant="secondary"
Expand All @@ -230,6 +231,7 @@ defmodule AlgoraWeb.Org.BountiesLive do
Edit Amount
</.button>
<.button
:if={@current_user_role in [:admin, :mod]}
phx-click="delete-bounty"
phx-value-id={bounty.id}
variant="destructive"
Expand Down