Skip to content

Commit

Permalink
add generated fields as part of the formula fields
Browse files Browse the repository at this point in the history
  • Loading branch information
pixl8-brayden committed Aug 10, 2023
1 parent 19d62e3 commit 5a13cdc
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions services/DataApiConfigurationService.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -679,9 +679,15 @@ component {
var fields = [];

for( var fieldName in props ) {
if ( ( len( trim( props[ fieldName ].formula ?: "" ) ) || len( trim( props[ fieldName ].default ?: "" ) ) ) &&
( !isBoolean( props[ fieldName ][ propEnabledKey ] ?: "" ) || !props[ fieldName ][ propEnabledKey ] )
) {
var isFormulaFields = Len( Trim( props[ fieldName ].formula ?: "" ) ) ||
Len( Trim( props[ fieldName ].default ?: "" ) ) ||
(
Len( Trim( props[ fieldName ].generate ?: "" ) ) &&
ArrayFindNoCase( [ "insert", "always" ], props[ fieldName ].generate ) &&
!ArrayFindNoCase( [ "UUID", "none" ], props[ fieldName ].generator ?: "" )
);

if ( isFormulaFields && ( !isBoolean( props[ fieldName ][ propEnabledKey ] ?: "" ) || !props[ fieldName ][ propEnabledKey ] ) ) {
arrayAppend( fields, fieldName );
}
}
Expand Down

0 comments on commit 5a13cdc

Please sign in to comment.