Version endpoints
This commit is contained in:
parent
f498f8672c
commit
56b93d42e5
|
@ -21,7 +21,7 @@ defmodule TuskerPushWeb.RegistrationsController do
|
|||
conn
|
||||
|> json(%{
|
||||
id: id,
|
||||
endpoint: url(~p"/mastodon/push/#{id}")
|
||||
endpoint: url(~p"/mastodon/v1/push/#{id}")
|
||||
})
|
||||
else
|
||||
{:error, %Changeset{valid?: false} = changeset} ->
|
||||
|
@ -64,7 +64,7 @@ defmodule TuskerPushWeb.RegistrationsController do
|
|||
{:registration, TuskerPush.get_registration(id)},
|
||||
{:ok, _} <- TuskerPush.update_registration(registration, params) do
|
||||
conn
|
||||
|> json(%{id: id, endpoint: url(~p"/mastodon/push/#{id}")})
|
||||
|> json(%{id: id, endpoint: url(~p"/mastodon/v1/push/#{id}")})
|
||||
else
|
||||
{:registration, nil} ->
|
||||
conn
|
||||
|
|
|
@ -8,12 +8,16 @@ defmodule TuskerPushWeb.Router do
|
|||
scope "/app", TuskerPushWeb do
|
||||
pipe_through :api
|
||||
|
||||
resources "/registrations", RegistrationsController, only: [:create, :update, :delete]
|
||||
scope "/v1" do
|
||||
resources "/registrations", RegistrationsController, only: [:create, :update, :delete]
|
||||
end
|
||||
end
|
||||
|
||||
scope "/mastodon", TuskerPushWeb do
|
||||
pipe_through :api
|
||||
|
||||
post "/push/:id", PushController, :push
|
||||
scope "/v1" do
|
||||
post "/push/:id", PushController, :push
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue