summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Felder <feld@feld.me>2024-01-30 14:19:32 -0500
committerMark Felder <feld@feld.me>2024-01-30 14:19:32 -0500
commit4a80a285d1c358a94a5f2401277968f457e01e2b (patch)
tree1e603e1fe606517d2cbd56ea2918e089a11410d8
parent1e76ceacd53325fdb5a6483d3d42926d6579d3cc (diff)
downloadpleroma-4a80a285d1c358a94a5f2401277968f457e01e2b.tar.gz
pleroma-4a80a285d1c358a94a5f2401277968f457e01e2b.zip
Revert "Pleroma.Web.PleromaAPI.NotificationController: dialyzer errors"
This reverts commit 26a95e57873630491066687d2a216ab6e01549b0.
-rw-r--r--lib/pleroma/web/api_spec/operations/pleroma_notification_operation.ex7
-rw-r--r--lib/pleroma/web/pleroma_api/controllers/notification_controller.ex4
2 files changed, 4 insertions, 7 deletions
diff --git a/lib/pleroma/web/api_spec/operations/pleroma_notification_operation.ex b/lib/pleroma/web/api_spec/operations/pleroma_notification_operation.ex
index 79990cb78..a994345db 100644
--- a/lib/pleroma/web/api_spec/operations/pleroma_notification_operation.ex
+++ b/lib/pleroma/web/api_spec/operations/pleroma_notification_operation.ex
@@ -24,11 +24,8 @@ defmodule Pleroma.Web.ApiSpec.PleromaNotificationOperation do
request_body("Parameters", %Schema{
type: :object,
properties: %{
- "id" => %Schema{type: :integer, description: "A single notification ID to read"},
- "max_id" => %Schema{
- type: :integer,
- description: "Read all notifications up to this ID"
- }
+ id: %Schema{type: :integer, description: "A single notification ID to read"},
+ max_id: %Schema{type: :integer, description: "Read all notifications up to this ID"}
}
}),
security: [%{"oAuth" => ["write:notifications"]}],
diff --git a/lib/pleroma/web/pleroma_api/controllers/notification_controller.ex b/lib/pleroma/web/pleroma_api/controllers/notification_controller.ex
index 0c6ec29f5..87ea81cef 100644
--- a/lib/pleroma/web/pleroma_api/controllers/notification_controller.ex
+++ b/lib/pleroma/web/pleroma_api/controllers/notification_controller.ex
@@ -16,7 +16,7 @@ defmodule Pleroma.Web.PleromaAPI.NotificationController do
defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.PleromaNotificationOperation
- def mark_as_read(%{assigns: %{user: user}, body_params: %{"id" => notification_id}} = conn, _) do
+ def mark_as_read(%{assigns: %{user: user}, body_params: %{id: notification_id}} = conn, _) do
with {:ok, notification} <- Notification.read_one(user, notification_id) do
render(conn, "show.json", notification: notification, for: user)
else
@@ -27,7 +27,7 @@ defmodule Pleroma.Web.PleromaAPI.NotificationController do
end
end
- def mark_as_read(%{assigns: %{user: user}, body_params: %{"max_id" => max_id}} = conn, _) do
+ def mark_as_read(%{assigns: %{user: user}, body_params: %{max_id: max_id}} = conn, _) do
notifications =
user
|> Notification.set_read_up_to(max_id)