diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-09-21 15:30:49 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-09-21 15:30:49 -0300 |
commit | c1018a0163ae28dc122aad7cb292a5e805c3d25a (patch) | |
tree | d2cabea77e11e02f766efacc258735e395682890 /src/data/things/thing.js | |
parent | e3e8a904c24e71f303a1f29c8f1700478d929901 (diff) |
data: fix update collation from steps
Diffstat (limited to 'src/data/things/thing.js')
-rw-r--r-- | src/data/things/thing.js | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/src/data/things/thing.js b/src/data/things/thing.js index 0dea1fa4..ca1018eb 100644 --- a/src/data/things/thing.js +++ b/src/data/things/thing.js @@ -281,24 +281,19 @@ export const referenceList = templateCompositeFrom({ compose: false, inputs: { - class: input(thingClassInput), + class: input.staticValue(thingClassInput), + find: input({type: 'function'}), // todo: validate data: input(), }, - update: { - dependencies: [ - input.staticValue('class'), - ], - - compute({ - [input.staticValue('class')]: thingClass, - }) { - const {[Thing.referenceType]: referenceType} = thingClass; - return {validate: validateReferenceList(referenceType)}; - }, + update: ({ + [input.staticValue('class')]: thingClass, + }) => { + const {[Thing.referenceType]: referenceType} = thingClass; + return {validate: validateReferenceList(referenceType)}; }, steps: () => [ @@ -326,17 +321,11 @@ export const singleReference = templateCompositeFrom({ data: input(), }, - update: { - dependencies: [ - input.staticValue('class'), - ], - - compute({ - [input.staticValue('class')]: thingClass, - }) { - const {[Thing.referenceType]: referenceType} = thingClass; - return {validate: validateReference(referenceType)}; - }, + update: ({ + [input.staticValue('class')]: thingClass, + }) => { + const {[Thing.referenceType]: referenceType} = thingClass; + return {validate: validateReference(referenceType)}; }, steps: () => [ |