Include device token in registration response
This commit is contained in:
parent
ba4e1d7abf
commit
26c0d2565b
|
@ -21,7 +21,8 @@ defmodule TuskerPushWeb.AppRegistrationsController do
|
||||||
conn
|
conn
|
||||||
|> json(%{
|
|> json(%{
|
||||||
id: id,
|
id: id,
|
||||||
endpoint: url(~p"/mastodon/v1/push/#{id}")
|
endpoint: url(~p"/mastodon/v1/push/#{id}"),
|
||||||
|
device_token: token
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
{:error, %Changeset{valid?: false} = changeset} ->
|
{:error, %Changeset{valid?: false} = changeset} ->
|
||||||
|
@ -64,7 +65,11 @@ defmodule TuskerPushWeb.AppRegistrationsController do
|
||||||
{:registration, TuskerPush.get_registration(id)},
|
{:registration, TuskerPush.get_registration(id)},
|
||||||
{:ok, _} <- TuskerPush.update_registration(registration, params) do
|
{:ok, _} <- TuskerPush.update_registration(registration, params) do
|
||||||
conn
|
conn
|
||||||
|> json(%{id: id, endpoint: url(~p"/mastodon/v1/push/#{id}")})
|
|> json(%{
|
||||||
|
id: id,
|
||||||
|
endpoint: url(~p"/mastodon/v1/push/#{id}"),
|
||||||
|
device_token: token
|
||||||
|
})
|
||||||
else
|
else
|
||||||
{:registration, nil} ->
|
{:registration, nil} ->
|
||||||
conn
|
conn
|
||||||
|
|
Loading…
Reference in New Issue