« get me outta code hell

data: withPropertiesFrom{Object,List} - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/things/thing.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-09-09 08:47:38 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-09-09 08:47:38 -0300
commit7a21c665d888b0db4c47c72049f7649bf1dabcde (patch)
tree0f35daa330a9520c90866d2f5eaf1f45791a1be3 /src/data/things/thing.js
parent726118e7e8eefa9002562ca2dd0a4f6deb8a05b9 (diff)
data: withPropertiesFrom{Object,List}
Diffstat (limited to 'src/data/things/thing.js')
-rw-r--r--src/data/things/thing.js17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/data/things/thing.js b/src/data/things/thing.js
index a87e6ed..52f0b77 100644
--- a/src/data/things/thing.js
+++ b/src/data/things/thing.js
@@ -15,7 +15,7 @@ import {
   exposeDependency,
   exposeDependencyOrContinue,
   raiseWithoutDependency,
-  withPropertyFromList,
+  withPropertiesFromList,
   withUpdateValueAsDependency,
 } from '#composite';
 
@@ -409,21 +409,24 @@ export function withResolvedContribs({
       raise: {into: []},
     }),
 
-    withPropertyFromList({list: from, property: 'who', into: '#artistRefs'}),
-    withPropertyFromList({list: from, property: 'what', into: '#what'}),
+    withPropertiesFromList({
+      list: from,
+      properties: ['who', 'what'],
+      prefix: '#contribs',
+    }),
 
     withResolvedReferenceList({
-      list: '#artistRefs',
+      list: '#contribs.who',
       data: 'artistData',
-      into: '#who',
+      into: '#contribs.who',
       find: find.artist,
       notFoundMode: 'null',
     }),
 
     {
-      dependencies: ['#who', '#what'],
+      dependencies: ['#contribs.who', '#contribs.what'],
       mapContinuation: {into},
-      compute({'#who': who, '#what': what}, continuation) {
+      compute({'#contribs.who': who, '#contribs.what': what}, continuation) {
         filterMultipleArrays(who, what, (who, _what) => who);
         return continuation({
           into: stitchArrays({who, what}),