Skip to content

Commit a09a791

Browse files
committed
fix: cancel endpoint
1 parent 66a6ffa commit a09a791

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/routes/copilotOpportunity/delete.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,17 @@ module.exports = [
4545
transaction,
4646
});
4747

48+
const promises = [];
4849
applications.forEach(async (application) => {
49-
await application.update({
50+
promises.push(application.update({
5051
status: COPILOT_APPLICATION_STATUS.CANCELED,
5152
}, {
5253
transaction,
53-
});
54+
}));
5455
});
5556

57+
await Promise.all(promises);
58+
5659
await copilotRequest.update({
5760
status: COPILOT_REQUEST_STATUS.CANCELED,
5861
}, {

0 commit comments

Comments
 (0)