Treat User.Info pinned ids as strings
This commit is contained in:
parent
e36a434b99
commit
973c9eed18
@ -31,7 +31,7 @@ defmodule Pleroma.User.Info do
|
|||||||
field(:hub, :string, default: nil)
|
field(:hub, :string, default: nil)
|
||||||
field(:salmon, :string, default: nil)
|
field(:salmon, :string, default: nil)
|
||||||
field(:hide_network, :boolean, default: false)
|
field(:hide_network, :boolean, default: false)
|
||||||
field(:pinned_activities, {:array, :integer}, default: [])
|
field(:pinned_activities, {:array, :string}, default: [])
|
||||||
|
|
||||||
# Found in the wild
|
# Found in the wild
|
||||||
# ap_id -> Where is this used?
|
# ap_id -> Where is this used?
|
||||||
|
@ -378,8 +378,7 @@ defmodule Pleroma.Web.TwitterAPI.Controller do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pin(%{assigns: %{user: user}} = conn, %{"id" => id}) do
|
def pin(%{assigns: %{user: user}} = conn, %{"id" => id}) do
|
||||||
with {_, {:ok, id}} <- {:param_cast, Ecto.Type.cast(:integer, id)},
|
with {:ok, activity} <- TwitterAPI.pin(user, id) do
|
||||||
{:ok, activity} <- TwitterAPI.pin(user, id) do
|
|
||||||
conn
|
conn
|
||||||
|> put_view(ActivityView)
|
|> put_view(ActivityView)
|
||||||
|> render("activity.json", %{activity: activity, for: user})
|
|> render("activity.json", %{activity: activity, for: user})
|
||||||
@ -390,8 +389,7 @@ defmodule Pleroma.Web.TwitterAPI.Controller do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def unpin(%{assigns: %{user: user}} = conn, %{"id" => id}) do
|
def unpin(%{assigns: %{user: user}} = conn, %{"id" => id}) do
|
||||||
with {_, {:ok, id}} <- {:param_cast, Ecto.Type.cast(:integer, id)},
|
with {:ok, activity} <- TwitterAPI.unpin(user, id) do
|
||||||
{:ok, activity} <- TwitterAPI.unpin(user, id) do
|
|
||||||
conn
|
conn
|
||||||
|> put_view(ActivityView)
|
|> put_view(ActivityView)
|
||||||
|> render("activity.json", %{activity: activity, for: user})
|
|> render("activity.json", %{activity: activity, for: user})
|
||||||
|
Loading…
Reference in New Issue
Block a user