Skip to content

Commit

Permalink
Changed postSave triggers to correctly use onUpdate config when the r…
Browse files Browse the repository at this point in the history
…ecord is updated.
  • Loading branch information
andrewbrazzatti committed May 6, 2021
1 parent f982f4a commit b86a697
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions typescript/api/services/RecordsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export module Services {
if (!_.isEmpty(recordType) && triggerPostSaveTriggers === true) {
// Trigger Post-save sync hooks ...
try {
updateResponse = await this.triggerPostSaveSyncTriggers(updateResponse['oid'], record, recordType, 'onCreate', user, updateResponse);
updateResponse = await this.triggerPostSaveSyncTriggers(updateResponse['oid'], record, recordType, 'onUpdate', user, updateResponse);
} catch (err) {
sails.log.error(`${this.logHeader} Exception while running post save sync hooks when updating:`);
sails.log.error(JSON.stringify(err));
Expand All @@ -190,7 +190,7 @@ export module Services {
return updateResponse;
}
// Fire Post-save hooks async ...
this.triggerPostSaveTriggers(updateResponse['oid'], record, recordType, 'onCreate', user);
this.triggerPostSaveTriggers(updateResponse['oid'], record, recordType, 'onUpdate', user);
}
this.searchService.index(oid, record);
// TODO: fire-off audit message
Expand Down

0 comments on commit b86a697

Please sign in to comment.