Implement operation hooks for EmbedsOne methods#904
Conversation
| var aCtxForModel = contextTestHelpers.aCtxForModel; | ||
|
|
||
| var uid = require('../helpers/uid-generator'); | ||
| var HookMonitor = require('../helpers/hook-monitor'); |
There was a problem hiding this comment.
Nitpick: Shouldn't these variables be alphabetical order? First variables starting with uppercase and then the variables with lowercase and alphabetical ordered?
PS: It applies to other places as well
There was a problem hiding this comment.
Well, we don't have any hard rule for ordering and grouping variables (module imports). Could you please post a code snippet showing how would you like to see L6-L13 ordered?
There was a problem hiding this comment.
we don't have any hard rule for ordering and grouping variables (module imports)
Oh I see... yea it was just a nitpick...I just saw some Strongloop folks prefer to have ASCI order of variables...
Something like this:
var ContextRecorder = contextTestHelpers.ContextRecorder;
var HookMonitor = require('../helpers/hook-monitor');
var ValidationError = require('../..').ValidationError;
var aCtxForModel = contextTestHelpers.aCtxForModel;
var contextTestHelpers = require('../helpers/context-test-helpers');
var uid = require('../helpers/uid-generator');
There was a problem hiding this comment.
So my comment should be ignored if we don't have this rule... I just thought we follow this rule... Thanks Miroslav for clarification :-)
|
LGTM |
|
@Amir-61 I think all comments have been addressed, I'll go ahead and land this without waiting for your final LGTM. |
create() triggers - before save - after save udpate() 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.
9e1b1e4 to
b86615e
Compare
create() triggers - before save - after save udpate() 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. [back-port of #904]
create() triggers - before save - after save udpate() 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. [back-port of loopbackio#904]
create() triggers - before save - after save udpate() 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. [back-port of loopbackio#904]
|
what about find?? |
create() triggers
udpate() triggers
destroy() triggers
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.
Connect to #497
See the original implementation proposed by @fabien in #516
/to @raymondfeng @Amir-61 please review
Things left out
before saveandafter savehooks should includectx.isNewInstancepersistandloadedhooks are not triggered at allbefore saveandafter savehooks 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 parent model.before deletehook does not providectx.whereproperty and it's not possible to change the outcome ofdestroy()using this hook. Note that regular DAO does support this.