File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ import { defineComponent, type PropType } from "vue"
46
46
47
47
import NewForm from " ./NewForm.vue"
48
48
import type { APIResponseMessage , FormConfig , Schema } from " ../interfaces"
49
- import { parseErrorResponse } from " .. /utils"
49
+ import { convertFormValue , parseErrorResponse } from " @ /utils"
50
50
import FormErrors from " ./FormErrors.vue"
51
51
52
52
const BASE_URL = import .meta .env .VITE_APP_BASE_URI
@@ -100,12 +100,11 @@ export default defineComponent({
100
100
const key = i [0 ]
101
101
let value: any = i [1 ]
102
102
103
- if (value == " null" ) {
104
- value = null
105
- } else if (this .schema .properties [key ].type == " array" ) {
106
- value = JSON .parse (value )
107
- }
108
- json [key ] = value
103
+ json [key ] = convertFormValue ({
104
+ key ,
105
+ value ,
106
+ schema: this .schema
107
+ })
109
108
}
110
109
111
110
try {
Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ export function convertFormValue(params: {
139
139
140
140
if ( value == "null" ) {
141
141
value = null
142
- } else if ( property . extra . nullable && value == "" ) {
142
+ } else if ( property . extra ? .nullable && value == "" ) {
143
143
value = null
144
144
} else if ( getType ( property ) == "array" ) {
145
145
value = JSON . parse ( String ( value ) )
You can’t perform that action at this time.
0 commit comments