diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-11-04 20:22:00 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-11-04 20:22:00 -0300 |
commit | 9e42c9f3773d431bc62fcf76f0da2cc852dfc329 (patch) | |
tree | 006d33d1627d30c86d61f0cf142afe1b9f85088c | |
parent | e42e5527b99426c1b74fea150cf62214de73087e (diff) |
data: wikiData: use validateWikiData instead of instance checks
-rw-r--r-- | src/data/composite/wiki-properties/wikiData.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/data/composite/wiki-properties/wikiData.js b/src/data/composite/wiki-properties/wikiData.js index 4ea47785..5965b949 100644 --- a/src/data/composite/wiki-properties/wikiData.js +++ b/src/data/composite/wiki-properties/wikiData.js @@ -1,17 +1,20 @@ // General purpose wiki data constructor, for properties like artistData, // trackData, etc. -import {validateArrayItems, validateInstanceOf} from '#validators'; +import {validateWikiData} from '#validators'; -// TODO: Not templateCompositeFrom. +// TODO: Kludge. +import Thing from '../../things/thing.js'; -// TODO: This should validate with validateWikiData. +// TODO: Not templateCompositeFrom. export default function(thingClass) { + const referenceType = thingClass[Thing.referenceType]; + return { flags: {update: true}, update: { - validate: validateArrayItems(validateInstanceOf(thingClass)), + validate: validateWikiData({referenceType}), }, }; } |