Skip to content

Commit 1dce026

Browse files
committed
Return better objects for float, integer and person elements
1 parent ecbbbd3 commit 1dce026

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

src/components/Inputs/MultiTextInput/MultiTextInput.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ export default {
3535
methods: {
3636
onSubmit(e) {
3737
e.preventDefault();
38-
const name = { first_name: this.input1, middle_name: this.input2, last_name: this.input3 };
38+
const name = { "schema:givenName": this.input1,
39+
"schema:additionalName": this.input2,
40+
"schema:familyName": this.input3,
41+
"@type": "schema:Person" };
3942
this.$emit('valueChanged', name);
4043
},
4144
},

src/components/Inputs/WebFloatInput/FloatInput.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ export default {
7373
this.$refs.form.className = 'was-validated';
7474
if (this.isValidFloat) {
7575
if (this.hasUnit) { // send value + unit
76-
const name = { value: this.input1, unitCode: this.input2 };
76+
const name = {
77+
value: this.input1,
78+
unitCode: this.input2,
79+
"@type": "schema:QuantitativeValue"
80+
};
7781
this.$emit('valueChanged', name);
7882
} else this.$emit('valueChanged', this.input1);
7983
}

src/components/Inputs/WebIntegerInput/IntegerInput.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ export default {
7373
this.$refs.form.className = 'was-validated';
7474
if (this.isValidInt) {
7575
if (this.hasUnit) { // send value + unit
76-
const name = { value: this.input1, unitCode: this.input2 };
76+
const name = {
77+
value: this.input1,
78+
unitCode: this.input2,
79+
"@type": "schema:QuantitativeValue"
80+
};
7781
this.$emit('valueChanged', name);
7882
} this.$emit('valueChanged', this.input1); // else send only value
7983
}

0 commit comments

Comments
 (0)