Rename SubscriptionNotificationController list and get actions to index and show
This commit is contained in:
parent
a76168e743
commit
7d1773bc6b
3 changed files with 13 additions and 13 deletions
|
|
@ -10,7 +10,7 @@ defmodule Pleroma.Web.PleromaAPI.SubscriptionNotificationController do
|
|||
alias Pleroma.SubscriptionNotification
|
||||
alias Pleroma.Web.PleromaAPI.PleromaAPI
|
||||
|
||||
def list(%{assigns: %{user: user}} = conn, params) do
|
||||
def index(%{assigns: %{user: user}} = conn, params) do
|
||||
notifications = PleromaAPI.get_subscription_notifications(user, params)
|
||||
|
||||
conn
|
||||
|
|
@ -18,7 +18,7 @@ defmodule Pleroma.Web.PleromaAPI.SubscriptionNotificationController do
|
|||
|> render("index.json", %{notifications: notifications, for: user})
|
||||
end
|
||||
|
||||
def get(%{assigns: %{user: user}} = conn, %{"id" => id} = _params) do
|
||||
def show(%{assigns: %{user: user}} = conn, %{"id" => id} = _params) do
|
||||
with {:ok, notification} <- SubscriptionNotification.get(user, id) do
|
||||
render(conn, "show.json", %{subscription_notification: notification, for: user})
|
||||
else
|
||||
|
|
|
|||
|
|
@ -273,8 +273,8 @@ defmodule Pleroma.Web.Router do
|
|||
post("/clear", SubscriptionNotificationController, :clear)
|
||||
post("/dismiss", SubscriptionNotificationController, :dismiss)
|
||||
delete("/destroy_multiple", SubscriptionNotificationController, :destroy_multiple)
|
||||
get("/", SubscriptionNotificationController, :list)
|
||||
get("/:id", SubscriptionNotificationController, :get)
|
||||
get("/", SubscriptionNotificationController, :index)
|
||||
get("/:id", SubscriptionNotificationController, :show)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue