end
def unreblog_status(%{assigns: %{user: user}} = conn, %{"id" => ap_id_or_id}) do
- with {:ok, announce, _activity} = CommonAPI.unrepeat(ap_id_or_id, user) do
- render(conn, StatusView, "status.json", %{activity: announce, for: user, as: :activity})
+ with {:ok, %{data: %{"id" => id}}} = CommonAPI.unrepeat(ap_id_or_id, user),
+ %Activity{} = activity <- Activity.get_create_activity_by_object_ap_id(id) do
+ render(conn, StatusView, "status.json", %{activity: activity, for: user, as: :activity})
end
end
|> assign(:user, user)
|> post("/api/v1/statuses/#{activity.id}/unreblog")
- assert %{"reblog" => %{"id" => id, "reblogged" => false, "reblogs_count" => 0}} =
+ assert %{"id" => id, "reblogged" => false, "reblogs_count" => 0} =
json_response(conn, 200)
assert to_string(activity.id) == id