Skip to content

Commit 5cc57d4

Browse files
committed
Include id when emitting event.
1 parent dc15a1e commit 5cc57d4

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

components/quickbooks/sources/common.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ module.exports = {
8181
await this.processEvent(entity);
8282
},
8383
async processEvent(entity) {
84+
const {name, id, operation} = entity
8485
const eventToEmit = {
8586
event_notification: entity,
8687
record_details: {},
@@ -89,14 +90,21 @@ module.exports = {
8990
// to get the full record data
9091
if (entity.operation !== "Delete") {
9192
eventToEmit.record_details = await this.quickbooks
92-
.getRecordDetails(entity.name, entity.id);
93+
.getRecordDetails(name, id);
9394
}
94-
95-
const summary = `${entity.name} ${entity.id} ${this.toPastTense(entity.operation)}`;
95+
const summary = `${name} ${id} ${this.toPastTense(operation)}`;
9696
const ts = entity?.lastUpdated
9797
? Date.parse(entity.lastUpdated)
9898
: Date.now();
99+
const event_id = [
100+
name,
101+
id,
102+
operation,
103+
ts,
104+
].join("-");
105+
console.log(event_id)
99106
this.$emit(eventToEmit, {
107+
id: event_id,
100108
summary,
101109
ts,
102110
});

0 commit comments

Comments
 (0)