simplifies logic in Relationship

This commit is contained in:
James
2020-01-23 17:35:27 -05:00
parent fb9962dbe6
commit fdd0225988
2 changed files with 10 additions and 10 deletions

View File

@@ -269,14 +269,14 @@ const RelationshipFieldType = (props) => {
useEffect(() => {
const formatDefaultValue = (valueToFormat) => {
let incomingRelatedDocument = valueToFormat;
if (hasMultipleRelations) {
incomingRelatedDocument = valueToFormat.value
return incomingRelatedDocument.id;
return {
...valueToFormat,
value: valueToFormat.value.id
};
}
return incomingRelatedDocument.id;
return valueToFormat.id;
}
if (defaultValue) {

View File

@@ -68,14 +68,14 @@ $stroke-width : 1px;
%inputShadow {
@extend %shadow-sm;
&:hover {
box-shadow: 0 2px 4px 0 rgba(0,2,4,.1),
0 5px 20px 0 rgba(0,2,4,.06);
&:hover {
box-shadow: 0 2px 4px 0 rgba(0,2,4,.1), 0 5px 20px 0 rgba(0,2,4,.06);
}
&:active, &:focus {
@extend %inputShadowActive;
}
box-shadow: 0 2px 4px 0 rgba(0,2,4,.1),
0 10px 20px 0 rgba(0,2,4,.08);
}
}
//////////////////////////////