mirror of
https://github.com/R0m1k3/noteflow.git
synced 2026-10-12 01:39:47 +02:00
Fix: Affichage articles RSS du plus ancien au plus récent
- Backend : Remet ORDER BY DESC (récent en premier de la DB) - Frontend : Ajoute .reverse() pour inverser et afficher ancien en premier - Résultat : Articles affichés du plus ancien au plus récent Cette approche garantit que le tri fonctionne côté frontend indépendamment du cache backend.
This commit is contained in:
2 files changed
+3
-2
No files matched your search
@@ -194,7 +194,7 @@ router.get('/articles', async (req, res) => {
|
||||
}
|
||||
|
||||
query += `
|
||||
ORDER BY a.pub_date ASC
|
||||
ORDER BY a.pub_date DESC
|
||||
LIMIT ?
|
||||
`;
|
||||
params.push(limit);
|
||||
|
||||
+2
-1
@@ -185,7 +185,8 @@ const Index = () => {
|
||||
try {
|
||||
const articles = await RssService.getArticles(100);
|
||||
if (Array.isArray(articles)) {
|
||||
setRssArticles(articles);
|
||||
// Inverser pour afficher les anciens articles en premier
|
||||
setRssArticles([...articles].reverse());
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Erreur lors du chargement des articles RSS:", error);
|
||||
|
||||
Reference in new issue
Block a user