diff --git a/src/Controller/ArticleController.php b/src/Controller/ArticleController.php index 027c784..bcc3bd2 100644 --- a/src/Controller/ArticleController.php +++ b/src/Controller/ArticleController.php @@ -138,7 +138,7 @@ class ArticleController extends AbstractController $key = new Key(); $pubkey = $key->convertToHex($npub); $repository = $entityManager->getRepository(Article::class); - $article = $repository->findOneBy(['slug' => $slug, 'pubkey' => $pubkey]); + $article = $repository->findOneBy(['slug' => $slug, 'pubkey' => $pubkey], ['createdAt' => 'DESC']); if (!$article) { throw $this->createNotFoundException('The article could not be found'); }