Skip to content

Commit 0398e2a

Browse files
committed
Update event.js
1 parent 1a38078 commit 0398e2a

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/models/event.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,17 @@ class Event {
7171
*/
7272
fillModel(schema) {
7373
Object.keys(schema).forEach(prop => {
74-
this[prop] = schema[prop];
74+
75+
if (prop === 'timestamp') {
76+
if (!this.payload) {
77+
this.payload = {};
78+
this.payload['timestamp'] = schema[prop];
79+
} else {
80+
this.payload[prop] = schema[prop];
81+
}
82+
} else {
83+
this[prop] = schema[prop];
84+
}
7585
});
7686
}
7787
}

0 commit comments

Comments
 (0)