diff options
author | Maxim Filippov <colixer@gmail.com> | 2019-09-02 22:48:52 +0300 |
---|---|---|
committer | Maxim Filippov <colixer@gmail.com> | 2019-09-02 22:48:52 +0300 |
commit | a4c5f71e933c905433b80c90bcd626e7da703669 (patch) | |
tree | d75a728d2d449f8f5c999dc8f91172a2cf7c23f4 /lib/pleroma/web/mastodon_api | |
parent | 6d33c89c4d27a1b52e69e1c14b408726410a6326 (diff) | |
download | pleroma-a4c5f71e933c905433b80c90bcd626e7da703669.tar.gz |
Return total from pagination + tests
Diffstat (limited to 'lib/pleroma/web/mastodon_api')
-rw-r--r-- | lib/pleroma/web/mastodon_api/controllers/mastodon_api_controller.ex | 2 | ||||
-rw-r--r-- | lib/pleroma/web/mastodon_api/mastodon_api.ex | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/pleroma/web/mastodon_api/controllers/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/controllers/mastodon_api_controller.ex index 83e877c0e..d532ba685 100644 --- a/lib/pleroma/web/mastodon_api/controllers/mastodon_api_controller.ex +++ b/lib/pleroma/web/mastodon_api/controllers/mastodon_api_controller.ex @@ -420,6 +420,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do [user.ap_id] |> ActivityPub.fetch_activities_query(params) |> Pagination.fetch_paginated(params) + |> Map.get(:items) conn |> add_link_headers(:dm_timeline, activities) @@ -1194,6 +1195,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do bookmarks = Bookmark.for_user_query(user.id) |> Pagination.fetch_paginated(params) + |> Map.get(:items) activities = bookmarks diff --git a/lib/pleroma/web/mastodon_api/mastodon_api.ex b/lib/pleroma/web/mastodon_api/mastodon_api.ex index ac01d1ff3..cf3962944 100644 --- a/lib/pleroma/web/mastodon_api/mastodon_api.ex +++ b/lib/pleroma/web/mastodon_api/mastodon_api.ex @@ -45,12 +45,14 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPI do user |> User.get_followers_query() |> Pagination.fetch_paginated(params) + |> Map.get(:items) end def get_friends(user, params \\ %{}) do user |> User.get_friends_query() |> Pagination.fetch_paginated(params) + |> Map.get(:items) end def get_notifications(user, params \\ %{}) do @@ -60,12 +62,14 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPI do |> Notification.for_user_query(options) |> restrict(:exclude_types, options) |> Pagination.fetch_paginated(params) + |> Map.get(:items) end def get_scheduled_activities(user, params \\ %{}) do user |> ScheduledActivity.for_user_query() |> Pagination.fetch_paginated(params) + |> Map.get(:items) end defp cast_params(params) do |