Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Public Libs
Elixir
Notification Dispatcher
Commits
25aeee1f
Commit
25aeee1f
authored
Oct 27, 2020
by
Miguel Basticioto
Browse files
feat: notification_message_controller
parent
8c2dc598
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/controllers/notification_message_controller.ex
0 → 100644
View file @
25aeee1f
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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment