我需要使用一些参数将补丁发送到端点。 这些参数之一是整数数组。
这是我的参数对象传递给调用之前的日志:https://gyazo.com/0a9042dc2411d9f25cc52080cc3b90c9
问题在于数组正在转换为浮点数:https://gyazo.com/4172379c0ab607a9b1abb4e87fe867db
这是axios的问题吗?
let params = {}
params.description = ""
params.files = [400, 401]
console.log("Params: " , params)
try {
yield call(axios.patch, endpoint, params)
} catch (er) {
console.log(er)
if (er.response.data) {
// map WS return errors to form format
// put the errors on each field and changed them to invalid
const newForm = mapWSErrorsToForm(er.response.data, form)
yield put(changeForm(newForm))
// try to scroll to first form field error
scrollToFirstFormError(newForm)
}
yield put(error([]))
}