Skip to content
This repository has been archived by the owner on Aug 28, 2019. It is now read-only.

Commit

Permalink
Integrated notification with unsubmit feature
Browse files Browse the repository at this point in the history
  • Loading branch information
geshuming committed Jun 18, 2019
1 parent 92ed7ed commit 5c5adcb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/cadet/accounts/notification.ex
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ defmodule Cadet.Accounts.Notification do
@doc """
Writes a new notification into the database, or updates an existing one
"""
@spec write(:any) :: Ecto.Changeset.t()
@spec write(map()) :: {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}
def write(params = %{role: role}) do
case role do
:student -> write_student(params)
Expand Down
5 changes: 5 additions & 0 deletions lib/cadet/assessments/assessments.ex
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,11 @@ defmodule Cadet.Assessments do
end)
|> Repo.transaction()

Cadet.Accounts.Notification.handle_unsubmit_notifications(
submission.assessment.id,
Cadet.Accounts.get_user(submission.student_id)
)

{:ok, nil}
else
{:submission_found?, false} ->
Expand Down

0 comments on commit 5c5adcb

Please sign in to comment.