@@ -89,9 +89,12 @@ function optionalBoundedString(
8989 return normalized
9090}
9191
92- /** `primary` unless it is unset (`undefined`, `null`, or `''`), else `fallback`. */
92+ function isUnset ( value : unknown ) : boolean {
93+ return value === undefined || value === null || value === ''
94+ }
95+
9396function firstSet ( primary : unknown , fallback : unknown ) : unknown {
94- return primary === undefined || primary === null || primary === '' ? fallback : primary
97+ return isUnset ( primary ) ? fallback : primary
9598}
9699
97100function getListPaginationParams (
@@ -933,7 +936,7 @@ export const MicrosoftDynamics365Block: BlockConfig = {
933936
934937 case 'qualify_lead' : {
935938 const qualifySwitch = ( value : unknown , label : string , defaultValue : boolean ) =>
936- isToolCall ( context ) && ( value === undefined || value === null || value === '' )
939+ isToolCall ( context ) && isUnset ( value )
937940 ? undefined
938941 : parseBooleanWithDefault ( value , label , defaultValue )
939942 const createAccount = qualifySwitch ( params . createAccount , 'Create account' , true )
@@ -956,9 +959,6 @@ export const MicrosoftDynamics365Block: BlockConfig = {
956959 params . qualifyOpportunityCurrencyId ,
957960 params . opportunityCurrencyId
958961 )
959- const dedicatedCustomerId = createOpportunity
960- ? optionalString ( params . qualifyOpportunityCustomerId )
961- : undefined
962962 const opportunityCustomerId = opportunityField (
963963 params . qualifyOpportunityCustomerId ,
964964 params . opportunityCustomerId
@@ -982,7 +982,7 @@ export const MicrosoftDynamics365Block: BlockConfig = {
982982 }
983983 const opportunityCustomerType = opportunityCustomerId
984984 ? requiredString (
985- dedicatedCustomerId
985+ optionalString ( params . qualifyOpportunityCustomerId )
986986 ? params . qualifyOpportunityCustomerType
987987 : firstSet (
988988 toolCallArg ( context , params . opportunityCustomerType ) ,
0 commit comments