Packages

Library used for integration with the rabbitmq for dispatching notification messages to consuming services.

Current section

Files

Jump to
notification_dispatcher lib controllers notification_message_controller.ex
Raw

lib/controllers/notification_message_controller.ex

defmodule NotificationDispatcher.Controller.NotificationMessageController do
alias NotificationDispatcher.Context.NotificationsContext
@doc """
Create can return {:ok, notification_message, json} or {:error, changeset}
"""
def create(params) do
case NotificationsContext.create_notification_message(params) do
{:ok, notification_message} ->
{:ok, notification_message, %{data: %{id: notification_message.id}}}
{:error, changeset} ->
{:error, changeset}
end
end
end