Skip to content

Commit 5f037f7

Browse files
Merge pull request #4 from IntuitDeveloper/apix-1705-use-for-loop
fix: apix-1705 use for loop to avoid confusion
2 parents fa8e630 + daac63d commit 5f037f7

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/main/java/com/intuit/developer/sampleapp/webhooks/service/queue/QueueProcessor.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,19 @@ public Object call() throws Exception {
6161

6262
//Convert payload to obj
6363
WebhooksEvent event = service.getWebhooksEvent(payload);
64-
EventNotification eventNotification = event.getEventNotifications().get(0);
64+
for (EventNotification eventNotification : event.getEventNotifications()) {
6565

66-
// get the company config
67-
CompanyConfig companyConfig = companyConfigService.getCompanyConfigByRealmId(eventNotification.getRealmId());
66+
// get the company config
67+
CompanyConfig companyConfig = companyConfigService.getCompanyConfigByRealmId(eventNotification.getRealmId());
6868

69-
// perform cdc with last updated timestamp and subscribed entities
70-
String cdcTimestamp = DateUtils.getStringFromDateTime(DateUtils.getCurrentDateTime());
71-
cdcService.callDataService(companyConfig);
72-
73-
// update cdcTimestamp in companyconfig
74-
companyConfig.setLastCdcTimestamp(cdcTimestamp);
75-
companyConfigService.save(companyConfig);
69+
// perform cdc with last updated timestamp and subscribed entities
70+
String cdcTimestamp = DateUtils.getStringFromDateTime(DateUtils.getCurrentDateTime());
71+
cdcService.callDataService(companyConfig);
7672

73+
// update cdcTimestamp in companyconfig
74+
companyConfig.setLastCdcTimestamp(cdcTimestamp);
75+
companyConfigService.save(companyConfig);
76+
}
7777
}
7878

7979
return null;

0 commit comments

Comments
 (0)