Make possible to alter response using the after save trigger (#5814)
* make possible to alter response using the after save trigger like for after find * code clearing to follow same object checking * remove console log debug * fix test unit
This commit is contained in:
committed by
Antonio Davi Macedo Coelho de Castro
parent
4fe0ff6ebf
commit
50f1e8eb77
@@ -1578,6 +1578,11 @@ RestWrite.prototype.runAfterSaveTrigger = function() {
|
||||
this.config,
|
||||
this.context
|
||||
)
|
||||
.then(result => {
|
||||
if (result && typeof result === 'object') {
|
||||
this.response.response = result;
|
||||
}
|
||||
})
|
||||
.catch(function(err) {
|
||||
logger.warn('afterSave caught an error', err);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user