update emit calls with constants

This commit is contained in:
2016-07-08 15:30:04 -07:00
parent 919fec4835
commit 3934f0cd1b
3 changed files with 14 additions and 15 deletions

View File

@@ -56,11 +56,11 @@ export default class Job extends events.EventEmitter {
version: doc._version,
};
this.debug(`Job created in index ${this.index}`);
this.emit('created', this.document);
this.emit(contstants.EVENT_JOB_CREATED, this.document);
})
.catch((err) => {
this.debug('Job creation failed', err);
this.emit('error', err);
this.emit(contstants.EVENT_JOB_ERROR, err);
});
}