From d619455e1ff8a220cc8564ed833ce2ec94d6f026 Mon Sep 17 00:00:00 2001 From: Ilya Prokopenko Date: Mon, 21 Mar 2022 17:11:53 +0300 Subject: [PATCH] Notes: Display new notes first Resolves #500 --- Web/Models/Repositories/Notes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Web/Models/Repositories/Notes.php b/Web/Models/Repositories/Notes.php index f1b19eaf..a41c6914 100644 --- a/Web/Models/Repositories/Notes.php +++ b/Web/Models/Repositories/Notes.php @@ -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); }