Order masto searches by date.

This commit is contained in:
lain 2018-04-10 18:38:52 +02:00
parent d7654f4b3c
commit 1dd2c8163f

View File

@ -515,7 +515,8 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
a.data, a.data,
^query ^query
), ),
limit: 20 limit: 20,
order_by: [desc: :inserted_at]
) )
statuses = Repo.all(q) ++ fetched statuses = Repo.all(q) ++ fetched
@ -605,35 +606,37 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
"video\/mp4" "video\/mp4"
] ]
}, },
settings: Map.get(user.info, "settings") || %{ settings:
onboarded: true, Map.get(user.info, "settings") ||
home: %{ %{
shows: %{ onboarded: true,
reblog: true, home: %{
reply: true shows: %{
} reblog: true,
}, reply: true
notifications: %{ }
alerts: %{ },
follow: true, notifications: %{
favourite: true, alerts: %{
reblog: true, follow: true,
mention: true favourite: true,
reblog: true,
mention: true
},
shows: %{
follow: true,
favourite: true,
reblog: true,
mention: true
},
sounds: %{
follow: true,
favourite: true,
reblog: true,
mention: true
}
}
}, },
shows: %{
follow: true,
favourite: true,
reblog: true,
mention: true
},
sounds: %{
follow: true,
favourite: true,
reblog: true,
mention: true
}
}
},
push_subscription: nil, push_subscription: nil,
accounts: accounts, accounts: accounts,
custom_emojis: mastodon_emoji, custom_emojis: mastodon_emoji,
@ -656,7 +659,8 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
{:ok, _user} <- User.update_and_set_cache(change) do {:ok, _user} <- User.update_and_set_cache(change) do
conn conn
|> json(%{}) |> json(%{})
else e -> else
e ->
conn conn
|> json(%{error: inspect(e)}) |> json(%{error: inspect(e)})
end end