« get me outta code hell

linkReferencingArtworks.js « dependencies « content « src - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/linkReferencingArtworks.js
blob: 6927f23040e82fddd3dfeddf2ddb6a7763b0fbf7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
export default {
  contentDependencies: [
    'linkAlbumReferencingArtworks',
    'linkTrackReferencingArtworks',
  ],

  relations: (relation, artwork) => ({
    link:
      (artwork.thing.isAlbum
        ? relation('linkAlbumReferencingArtworks', artwork.thing)
     : artwork.thing.isTrack
        ? relation('linkTrackReferencingArtworks', artwork.thing)
        : null),
  }),

  generate: (relations) => relations.link,
};