Skip to content

Commit 724d028

Browse files
committed
fix: cancel all copilot requests for a project when manually copilot is added
1 parent 2065478 commit 724d028

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

src/routes/projectMemberInvites/update.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ module.exports = [
173173
transaction: t,
174174
});
175175
} else if (source === INVITE_SOURCE.WORK_MANAGER) {
176-
req.log.info("cancelling all existing requests", source);
177176
const allCopilotRequestsByProjectId = await models.CopilotRequest.findAll({
178177
where: {
179178
projectId: invite.projectId,
@@ -182,7 +181,6 @@ module.exports = [
182181
});
183182

184183
const requestIds = allCopilotRequestsByProjectId.map(item => item.id);
185-
req.log.info("requestIds", requestIds);
186184

187185
await models.CopilotRequest.update({
188186
status: COPILOT_REQUEST_STATUS.CANCELED,
@@ -195,8 +193,6 @@ module.exports = [
195193
transaction: t,
196194
});
197195

198-
req.log.info("updated copilot request");
199-
200196
const allCopilotOpportunityByRequestIds = await models.CopilotOpportunity.findAll({
201197
where: {
202198
copilotRequestId: {
@@ -206,8 +202,6 @@ module.exports = [
206202
transaction: t,
207203
});
208204

209-
req.log.info("allCopilotOpportunityByRequestIds", allCopilotOpportunityByRequestIds.length);
210-
211205
await models.CopilotOpportunity.update({
212206
status: COPILOT_OPPORTUNITY_STATUS.CANCELED,
213207
}, {
@@ -219,8 +213,6 @@ module.exports = [
219213
transaction: t,
220214
});
221215

222-
req.log.info("updated copilot opportunity");
223-
224216
await models.CopilotApplication.update({
225217
status: COPILOT_APPLICATION_STATUS.CANCELED,
226218
}, {
@@ -231,8 +223,6 @@ module.exports = [
231223
},
232224
transaction: t,
233225
});
234-
235-
req.log.info("updated CopilotApplication");
236226
}
237227

238228
await t.commit();

0 commit comments

Comments
 (0)