revert: feat: Allow to skip submitting empty values in form data (#5830)
This reverts commit b9b32c9c93.
Refs #6203 #5830
This commit is contained in:
@@ -5,7 +5,7 @@ import serializeError from "serialize-error"
|
||||
import isString from "lodash/isString"
|
||||
import debounce from "lodash/debounce"
|
||||
import set from "lodash/set"
|
||||
import { isJSONObject, paramToValue, isEmptyValue } from "core/utils"
|
||||
import { isJSONObject, paramToValue } from "core/utils"
|
||||
|
||||
// Actions conform to FSA (flux-standard-actions)
|
||||
// {type: string,payload: Any|Error, meta: obj, error: bool}
|
||||
@@ -401,12 +401,11 @@ export const executeRequest = (req) =>
|
||||
req.requestContentType = oas3Selectors.requestContentType(pathName, method)
|
||||
req.responseContentType = oas3Selectors.responseContentType(pathName, method) || "*/*"
|
||||
const requestBody = oas3Selectors.requestBodyValue(pathName, method)
|
||||
const requestBodyInclusionSetting = oas3Selectors.requestBodyInclusionSetting(pathName, method)
|
||||
|
||||
if(isJSONObject(requestBody)) {
|
||||
req.requestBody = JSON.parse(requestBody)
|
||||
} else if(requestBody && requestBody.toJS) {
|
||||
req.requestBody = requestBody.filter((value, key) => !isEmptyValue(value) || requestBodyInclusionSetting.get(key)).toJS()
|
||||
req.requestBody = requestBody.toJS()
|
||||
} else{
|
||||
req.requestBody = requestBody
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user