File tree Expand file tree Collapse file tree
src/tasks/opportunity-status-processor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ export async function runOpportunityStatusProcessor(message, context) {
7474
7575 // Track processed opportunity types to avoid duplicates
7676 const processedTypes = new Set ( ) ;
77+ const statusMessages = [ ] ;
7778
7879 // Process each opportunity
7980 for ( const opportunity of opportunities ) {
@@ -99,10 +100,14 @@ export async function runOpportunityStatusProcessor(message, context) {
99100 const hasSuggestions = suggestions && suggestions . length > 0 ;
100101 const status = hasSuggestions ? ':white_check_mark:' : ':cross-x:' ;
101102
102- // Send Slack message
103- const slackMessage = `${ opportunityTitle } ${ status } ` ;
104- // eslint-disable-next-line no-await-in-loop
105- await say ( env , log , slackContext , slackMessage ) ;
103+ // Add to status messages array
104+ statusMessages . push ( `${ opportunityTitle } ${ status } ` ) ;
105+ }
106+
107+ // Send combined status message
108+ if ( statusMessages . length > 0 ) {
109+ const combinedMessage = statusMessages . join ( ', ' ) ;
110+ await say ( env , log , slackContext , combinedMessage ) ;
106111 }
107112
108113 log . info ( 'Opportunity status checking completed' ) ;
You can’t perform that action at this time.
0 commit comments