« get me outta code hell

data, yaml: store sorting info on getYamlLoadingSpec - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/things/news-entry.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-01-29 08:22:53 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-01-30 07:59:40 -0400
commit2960fb60606ce0e356f7cb62c3b17e9d41e742fc (patch)
tree0976c8866912ed81d757a53c4315361cdf01aed6 /src/data/things/news-entry.js
parenteb8b316bb9af7d34720de1fa8f8dbd4b81513b32 (diff)
data, yaml: store sorting info on getYamlLoadingSpec
Diffstat (limited to 'src/data/things/news-entry.js')
-rw-r--r--src/data/things/news-entry.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/data/things/news-entry.js b/src/data/things/news-entry.js
index 658453b..e0ec7f7 100644
--- a/src/data/things/news-entry.js
+++ b/src/data/things/news-entry.js
@@ -57,11 +57,10 @@ export class NewsEntry extends Thing {
     documentMode: allInOne,
     documentThing: NewsEntry,
 
-    save(newsData) {
-      sortChronologically(newsData);
-      newsData.reverse();
+    save: (results) => ({newsData: results}),
 
-      return {newsData};
+    sort({newsData}) {
+      sortChronologically(newsData, {latestFirst: true});
     },
   });
 }