@@ -173,6 +173,7 @@ module.exports = [
173
173
transaction : t ,
174
174
} ) ;
175
175
} else if ( source === INVITE_SOURCE . WORK_MANAGER ) {
176
+ req . log . info ( "cancelling all existing requests" , source ) ;
176
177
const allCopilotRequestsByProjectId = await models . CopilotRequest . findAll ( {
177
178
where : {
178
179
projectId : invite . projectId ,
@@ -181,6 +182,7 @@ module.exports = [
181
182
} ) ;
182
183
183
184
const requestIds = allCopilotRequestsByProjectId . map ( item => item . id ) ;
185
+ req . log . info ( "requestIds" , requestIds ) ;
184
186
185
187
await models . CopilotRequest . update ( {
186
188
status : COPILOT_REQUEST_STATUS . CANCELED ,
@@ -193,6 +195,8 @@ module.exports = [
193
195
transaction : t ,
194
196
} ) ;
195
197
198
+ req . log . info ( "updated copilot request" ) ;
199
+
196
200
const allCopilotOpportunityByRequestIds = await models . CopilotOpportunity . findAll ( {
197
201
where : {
198
202
copilotRequestId : {
@@ -202,6 +206,8 @@ module.exports = [
202
206
transaction : t ,
203
207
} ) ;
204
208
209
+ req . log . info ( "allCopilotOpportunityByRequestIds" , allCopilotOpportunityByRequestIds . length ) ;
210
+
205
211
await models . CopilotOpportunity . update ( {
206
212
status : COPILOT_OPPORTUNITY_STATUS . CANCELED ,
207
213
} , {
@@ -213,6 +219,8 @@ module.exports = [
213
219
transaction : t ,
214
220
} ) ;
215
221
222
+ req . log . info ( "updated copilot opportunity" ) ;
223
+
216
224
await models . CopilotApplication . update ( {
217
225
status : COPILOT_APPLICATION_STATUS . CANCELED ,
218
226
} , {
@@ -223,6 +231,8 @@ module.exports = [
223
231
} ,
224
232
transaction : t ,
225
233
} ) ;
234
+
235
+ req . log . info ( "updated CopilotApplication" ) ;
226
236
}
227
237
228
238
await t . commit ( ) ;
0 commit comments