mark reports as opened when claimed and unclaimed

This commit is contained in:
byte[] 2020-04-30 14:43:23 -04:00
parent 44b004f9ec
commit 22bd05350d

View file

@ -39,12 +39,14 @@ defmodule Philomena.Reports.Report do
change(report) change(report)
|> validate_inclusion(:admin_id, []) |> validate_inclusion(:admin_id, [])
|> put_change(:admin_id, user.id) |> put_change(:admin_id, user.id)
|> put_change(:open, true)
|> put_change(:state, "in_progress") |> put_change(:state, "in_progress")
end end
def unclaim_changeset(report) do def unclaim_changeset(report) do
change(report) change(report)
|> put_change(:admin_id, nil) |> put_change(:admin_id, nil)
|> put_change(:open, true)
|> put_change(:state, "open") |> put_change(:state, "open")
end end