Skip to content

Commit

Permalink
feat(ex/notifications): create detour notification "getter"
Browse files Browse the repository at this point in the history
  • Loading branch information
firestack committed Oct 1, 2024
1 parent 1c7c64e commit 99c2899
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/notifications/notification.ex
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,14 @@ defmodule Notifications.Notification do

# We need the associated values in the Detour JSON, so query the DB with the
# id to load the extra data.
get_detour_notification(notification.id)
end

def get_detour_notification(notification_id) do
import Notifications.Db.Notification.Queries

select_detour_info()
|> where([notification: n], n.id == ^notification.id)
|> where([notification: n], n.id == ^notification_id)
|> Skate.Repo.one!()
|> from_db_notification()
end
Expand Down

0 comments on commit 99c2899

Please sign in to comment.