@8base/utils
Advanced tools
Comparing version 0.5.6 to 0.5.7
@@ -246,8 +246,15 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
var formatFieldDataListItem_formatFieldDataListItem = function formatFieldDataListItem(type, fieldSchema, data, schema) { | ||
var nextData = data; | ||
if (typeof nextData === 'string') { | ||
if (external_ramda_["isNil"](nextData)) { | ||
return { | ||
type: type === MUTATION_TYPE.CREATE ? 'connect' : 'reconnect', | ||
data: {} | ||
}; | ||
} else if (typeof nextData === 'string') { | ||
return { | ||
type: type === MUTATION_TYPE.CREATE ? 'connect' : 'reconnect', | ||
data: { id: nextData } | ||
@@ -303,11 +310,5 @@ }; | ||
var formatFieldDataForMutation_formatFieldDataForMutation = function formatFieldDataForMutation(type, fieldSchema, data, schema) { | ||
var nextData = data; | ||
if (external_ramda_["isNil"](data)) { | ||
return nextData; | ||
} | ||
if (isFileField(fieldSchema) || isRelationField(fieldSchema)) { | ||
@@ -314,0 +315,0 @@ if (isListField(fieldSchema)) { |
{ | ||
"name": "@8base/utils", | ||
"version": "0.5.6", | ||
"version": "0.5.7", | ||
"main": "lib/utils.js", | ||
@@ -22,3 +22,3 @@ "scripts": { | ||
"devDependencies": { | ||
"@8base/webpack-configuration": "^0.5.6", | ||
"@8base/webpack-configuration": "^0.5.7", | ||
"babel-cli": "^6.26.0", | ||
@@ -25,0 +25,0 @@ "babel-core": "^6.26.3", |
//@flow | ||
import * as R from 'ramda'; | ||
import { isListField, isFileField, isRelationField } from '../verifiers'; | ||
@@ -13,6 +11,2 @@ import { formatFieldDataList } from './formatFieldDataList'; | ||
if (R.isNil(data)) { | ||
return nextData; | ||
} | ||
if (isFileField(fieldSchema) || isRelationField(fieldSchema)) { | ||
@@ -19,0 +13,0 @@ if (isListField(fieldSchema)) { |
//@flow | ||
import * as R from 'ramda'; | ||
import { isRelationField } from '../verifiers'; | ||
@@ -12,5 +14,10 @@ import { getTableSchemaById } from '../selectors'; | ||
if (typeof nextData === 'string') { | ||
if (R.isNil(nextData)) { | ||
return { | ||
type: type === MUTATION_TYPE.CREATE ? 'connect' : 'reconnect', | ||
data: {}, | ||
}; | ||
} else if (typeof nextData === 'string') { | ||
return { | ||
type: type === MUTATION_TYPE.CREATE ? 'connect' : 'reconnect', | ||
data: { id: nextData }, | ||
@@ -17,0 +24,0 @@ }; |
Sorry, the diff of this file is not supported yet
295232
723