Skip to content

Commit 595e046

Browse files
authored
Merge pull request #817 from topcoder-platform/pm-1169_2
fix: sync issue between db and es
2 parents 77b0fb0 + 4c45e27 commit 595e046

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ workflows:
149149
context : org-global
150150
filters:
151151
branches:
152-
only: ['develop', 'migration-setup', 'pm-1169_1']
152+
only: ['develop', 'migration-setup']
153153
- deployProd:
154154
context : org-global
155155
filters:

src/routes/projectMemberInvites/update.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,15 @@ module.exports = [
233233
transaction: t,
234234
});
235235

236+
const invitesToBeUpdated = await models.ProjectMemberInvite.findAll({
237+
where: {
238+
applicationId: {
239+
[Op.in]: copilotApplications.map(item => item.id),
240+
}
241+
},
242+
transaction: t,
243+
});
244+
236245
// Cancel the existing invites which are opened via
237246
// applications
238247
await models.ProjectMemberInvite.update({
@@ -245,6 +254,14 @@ module.exports = [
245254
},
246255
transaction: t,
247256
});
257+
258+
invitesToBeUpdated.forEach((inviteToBeUpdated) => {
259+
util.sendResourceToKafkaBus(
260+
req,
261+
EVENT.ROUTING_KEY.PROJECT_MEMBER_INVITE_UPDATED,
262+
RESOURCES.PROJECT_MEMBER_INVITE,
263+
inviteToBeUpdated.toJSON());
264+
})
248265
}
249266

250267
await t.commit();

0 commit comments

Comments
 (0)