@8base/utils
Advanced tools
Comparing version 0.4.21 to 0.4.22
@@ -490,2 +490,13 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
if (isRelationReference_isRelationReference(fieldSchema, data[fieldName]) && !isFileField(fieldSchema)) { | ||
if (isListField(fieldSchema)) { | ||
result = external_ramda_["assoc"](fieldName, data[fieldName].map(function (_ref) { | ||
var id = _ref.id; | ||
return id; | ||
}), result); | ||
} else { | ||
result = external_ramda_["assoc"](fieldName, data[fieldName].id, result); | ||
} | ||
} | ||
return result; | ||
@@ -492,0 +503,0 @@ }, {}, external_ramda_["keys"](data)); |
{ | ||
"name": "@8base/utils", | ||
"version": "0.4.21", | ||
"version": "0.4.22", | ||
"main": "lib/utils.js", | ||
@@ -22,3 +22,3 @@ "scripts": { | ||
"devDependencies": { | ||
"@8base/webpack-configuration": "^0.4.21", | ||
"@8base/webpack-configuration": "^0.4.22", | ||
"babel-cli": "^6.26.0", | ||
@@ -25,0 +25,0 @@ "babel-core": "^6.26.3", |
@@ -5,3 +5,3 @@ //@flow | ||
import { getFieldSchemaByName, getTableSchemaByName } from '../selectors'; | ||
import { isRelationField, isFileField, isListField, isMetaField } from '../verifiers'; | ||
import { isRelationField, isRelationReference, isFileField, isListField, isMetaField } from '../verifiers'; | ||
import type { FieldSchema, TableSchema, Schema } from '../types'; | ||
@@ -37,2 +37,10 @@ | ||
if (isRelationReference(fieldSchema, data[fieldName]) && !isFileField(fieldSchema)) { | ||
if (isListField(fieldSchema)) { | ||
result = R.assoc(fieldName, data[fieldName].map(({ id }) => id), result); | ||
} else { | ||
result = R.assoc(fieldName, data[fieldName].id, result); | ||
} | ||
} | ||
return result; | ||
@@ -39,0 +47,0 @@ }, {}, R.keys(data)); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
301351
803