Bug 38201: (follow-up) Fix JS warning for deliverytime on the Vendor edit for

Happened again with discount
[Vue warn]: Invalid prop: type check failed for prop "modelValue". Expected String with value "1.75", got Number with value 1.75.
  at <InputNumber key=1 id="discount" modelValue=1.75  ... >

(cherry picked from commit e44d7ceda0369a44964dd1cb715d53f8740a9556)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2025-09-25 16:07:54 +02:00 committed by Lucas Gass
parent 09b64a9d84
commit 91db3f7786
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
2 changed files with 2 additions and 4 deletions

View File

@ -14,7 +14,7 @@ import { computed } from "vue";
export default {
props: {
id: String,
modelValue: String | Number,
modelValue: Number | String,
placeholder: String,
required: Boolean,
size: Number | null,
@ -23,7 +23,7 @@ export default {
setup(props, { emit }) {
const model = computed({
get() {
return props.modelValue.toString();
return parseFloat(props.modelValue);
},
set(value) {
emit("update:modelValue", value);

View File

@ -832,8 +832,6 @@ export default {
componentData.resource.value.discount =
componentData.resource.value.discount.toFixed(1);
}
componentData.resource.value.deliverytime =
resource.deliverytime.toString();
}
if (caller === "show") {
let physicalAddress = "";