Commit 25aeee1f authored by Miguel Basticioto's avatar Miguel Basticioto
Browse files

feat: notification_message_controller

parent 8c2dc598
defmodule NotificationDispatcher.Controller.NotificationMessageController do
alias NotificationDispatcher.Context.NotificationsContext
@doc """
Create can return {:ok, notification_message} or {:error, changeset}
"""
def create(conn, 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
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment