Notes: Display new notes first

Resolves #500
This commit is contained in:
Ilya Prokopenko 2022-03-21 17:11:53 +03:00
parent 88cbde660b
commit d619455e1f
No known key found for this signature in database
GPG key ID: 7736BBBB05F14A56

View file

@ -29,7 +29,7 @@ class Notes
function getUserNotes(User $user, int $page = 1, ?int $perPage = NULL): \Traversable
{
$perPage = $perPage ?? OPENVK_DEFAULT_PER_PAGE;
foreach($this->notes->where("owner", $user->getId())->where("deleted", 0)->page($page, $perPage) as $album)
foreach($this->notes->where("owner", $user->getId())->where("deleted", 0)->order("created DESC")->page($page, $perPage) as $album)
yield new Note($album);
}