« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/composite/wiki-properties/soupyReverse.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/data/composite/wiki-properties/soupyReverse.js')
-rw-r--r--src/data/composite/wiki-properties/soupyReverse.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/data/composite/wiki-properties/soupyReverse.js b/src/data/composite/wiki-properties/soupyReverse.js
index 269ccd6f..a3171738 100644
--- a/src/data/composite/wiki-properties/soupyReverse.js
+++ b/src/data/composite/wiki-properties/soupyReverse.js
@@ -19,4 +19,16 @@ soupyReverse.contributionsBy =
     referenced: contrib => [contrib.artist],
   });
 
+soupyReverse.artworkContributionsBy =
+  (bindTo, artworkProperty) => ({
+    bindTo,
+
+    referencing: thing =>
+      (thing[artworkProperty]
+        ? thing[artworkProperty].artistContribs
+        : []),
+
+    referenced: contrib => [contrib.artist],
+  });
+
 export default soupyReverse;