@@ -130,7 +130,7 @@ app.options(/category_select-.*/, async ({ options, ack }) => {
130
130
} ) ;
131
131
132
132
// Listen for the interaction from the dropdown menu
133
- app . action ( / c a t e g o r y _ s e l e c t - .* / , async ( { body, ack, say } ) => {
133
+ app . action ( / c a t e g o r y _ s e l e c t - .* / , async ( { body, ack, respond } ) => {
134
134
// Acknowledge the action
135
135
await ack ( ) ;
136
136
console . log ( "body" , body ) ;
@@ -141,11 +141,16 @@ app.action(/category_select-.*/, async ({ body, ack, say }) => {
141
141
const selectedCategory = body . actions [ 0 ] . selected_option . text . text ;
142
142
const dropdown_id = body . actions [ 0 ] . action_id ;
143
143
try {
144
- addOrUpdateInc ( body . user . username , text , selectedCategory , dropdown_id ) ;
145
- await say ( `You selected: ${ selectedCategory } ` ) ;
144
+ // Add or update the incident
145
+ await addOrUpdateInc ( body . user . username , text , selectedCategory , dropdown_id ) ;
146
+ await respond ( {
147
+ text : `✅ You selected: ${ selectedCategory } ` , // Message with checkmark
148
+ } ) ;
146
149
} catch ( error ) {
147
- say ( "There was an error adding the incident. Please try again later." ) ;
148
- console . error ( "Error adding incident:" , error ) ;
150
+ await respond ( {
151
+ text : "❌ There was an error adding the incident. Please try again later." ,
152
+ } ) ;
153
+ console . error ( "Error adding incident:" , error ) ;
149
154
}
150
155
151
156
} ) ;
0 commit comments