« get me outta code hell

data: roll paired "byRef" and "dynamic" properties into one - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/things/group.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-09-07 17:30:54 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-09-07 17:30:54 -0300
commitbbccaf51222cb4bed73466164496f5bc1030292c (patch)
treefc26c89f44b84140ba01b9edabedef10c73a637a /src/data/things/group.js
parentc18844784bd1c0ead7c49d0519727b7a92e23e13 (diff)
data: roll paired "byRef" and "dynamic" properties into one
Diffstat (limited to 'src/data/things/group.js')
-rw-r--r--src/data/things/group.js27
1 files changed, 10 insertions, 17 deletions
diff --git a/src/data/things/group.js b/src/data/things/group.js
index 873c6d8..f53fa48 100644
--- a/src/data/things/group.js
+++ b/src/data/things/group.js
@@ -5,7 +5,6 @@ import Thing, {
   directory,
   name,
   referenceList,
-  resolvedReferenceList,
   simpleString,
   urls,
   wikiData,
@@ -24,7 +23,11 @@ export class Group extends Thing {
 
     urls: urls(),
 
-    featuredAlbumsByRef: referenceList(Album),
+    featuredAlbums: referenceList({
+      class: Album,
+      find: find.album,
+      data: 'albumData',
+    }),
 
     // Update only
 
@@ -33,12 +36,6 @@ export class Group extends Thing {
 
     // Expose only
 
-    featuredAlbums: resolvedReferenceList({
-      list: 'featuredAlbumsByRef',
-      data: 'albumData',
-      find: find.album,
-    }),
-
     descriptionShort: {
       flags: {expose: true},
 
@@ -89,18 +86,14 @@ export class GroupCategory extends Thing {
     name: name('Unnamed Group Category'),
     color: color(),
 
-    groupsByRef: referenceList(Group),
+    groups: referenceList({
+      class: Group,
+      find: find.group,
+      data: 'groupData',
+    }),
 
     // Update only
 
     groupData: wikiData(Group),
-
-    // Expose only
-
-    groups: resolvedReferenceList({
-      list: 'groupsByRef',
-      data: 'groupData',
-      find: find.group,
-    }),
   });
 }