loopback-datasource-juggler/test/operation-hooks.suite
Miroslav Bajtoš 9bde8f859b Implement operation hooks for EmbedsMany methods
create() triggers
 - before save
 - after save

updateById() triggers
 - before save
 - after save

destroy() triggers
 - before delete
 - after delete

The implementation here is intentionally left with less features
than the regular DAO methods provide, the goal is to get a partial
(but still useful!) version released soon.

Limitations:

 - `before save` & `after save` hooks don't provide `ctx.isNewInstance`
 - async validations are not supported yet
 - `persist` and `loaded` hooks are not triggered at all

 - `before delete` hook does not provide `ctx.where` property and
    it's not possible to change the outcome of `destroy()` using this
    hook. Note that regular DAO does support this.

 - updating embedded instances triggers update of the parent (owning)
   model, which is correct and expected. However, the context provided
   by `before save` and `after save` hooks on the parent model is sort of
   arbitrary and may include wrong/extra data. The same probably applies
   to the scenario when deleting embedded instances triggers update of
   the parent model.
2016-04-27 11:04:15 +02:00
..
embeds-many-create.suite.js Implement operation hooks for EmbedsMany methods 2016-04-27 11:04:15 +02:00
embeds-many-destroy.suite.js Implement operation hooks for EmbedsMany methods 2016-04-27 11:04:15 +02:00
embeds-many-update-by-id.suite.js Implement operation hooks for EmbedsMany methods 2016-04-27 11:04:15 +02:00
embeds-one-create.suite.js Implement operation hooks for EmbedsOne methods 2016-04-20 09:36:12 +02:00
embeds-one-destroy.suite.js Implement operation hooks for EmbedsOne methods 2016-04-20 09:36:12 +02:00
embeds-one-update.suite.js Implement operation hooks for EmbedsOne methods 2016-04-20 09:36:12 +02:00
index.js Implement operation hooks for EmbedsOne methods 2016-04-20 09:36:12 +02:00