From 1c6d49fc8beddc2608adf43bd269a2e509cfbb70 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 24 Apr 2024 11:14:59 -0300 Subject: data: misc adaptations for who/what -> artist/annotation --- src/data/checks.js | 2 +- src/data/serialize.js | 5 ++++- src/util/serialize.js | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/data/checks.js b/src/data/checks.js index 44f3efd7..c0eba0ff 100644 --- a/src/data/checks.js +++ b/src/data/checks.js @@ -261,7 +261,7 @@ export function filterReferenceErrors(wikiData, { break; case '_contrib': - findFn = contribRef => findArtistOrAlias(contribRef.who); + findFn = contribRef => findArtistOrAlias(contribRef.artist); break; case '_homepageSourceGroup': diff --git a/src/data/serialize.js b/src/data/serialize.js index 8cac3309..2ecbf76c 100644 --- a/src/data/serialize.js +++ b/src/data/serialize.js @@ -16,7 +16,10 @@ export function toRefs(things) { } export function toContribRefs(contribs) { - return contribs?.map(({who, what}) => ({who: toRef(who), what})); + return contribs?.map(({artist, annotation}) => ({ + artist: toRef(artist), + annotation, + })); } export function toCommentaryRefs(entries) { diff --git a/src/util/serialize.js b/src/util/serialize.js index 4992e2bf..eb18a759 100644 --- a/src/util/serialize.js +++ b/src/util/serialize.js @@ -14,10 +14,10 @@ export function serializeLink(thing) { } export function serializeContribs(contribs) { - return contribs.map(({who, what}) => { + return contribs.map(({artist, annotation}) => { const ret = {}; - ret.artist = serializeLink(who); - if (what) ret.contribution = what; + ret.artist = serializeLink(artist); + if (annotation) ret.contribution = annotation; return ret; }); } -- cgit 1.3.0-6-gf8a5