-
Notifications
You must be signed in to change notification settings - Fork 43
move sample realtime events for put/patch/delete to api layer #294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
move sample realtime events for put/patch/delete to api layer #294
Conversation
| const aspName = nameParts[1]; | ||
| const subOpts = { | ||
| where: { | ||
| absolutePath: subName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
case insensitive?
| }; | ||
| const aspOpts = { | ||
| where: { | ||
| name: aspName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
case insensitive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aspectName and subjectName are always from the "sample.name" field from the db and the "sample.name" field is formed from its subject and its aspect in the db. So the case always matches when we do the find here.
| .catch(done); | ||
| }); | ||
|
|
||
| it('when tried to publish sample without aspect,'+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any other tests we can add here to make sure that we aren't breaking any of the existing realtime event publishing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sample object the is finally passed to the real-time emitter should have the following fields/objects to not to break anything
- absolutePath - as a field copied over from subject absolutePath
- subject object always attached - having tags field
- aspect object always attached having tags field
I have added tests to check for these.
api/v1/helpers/verbs/doPut.js
Outdated
| // publish the update event to the redis channel | ||
| if (props.publishEvents) { | ||
| publisher.publishSample(o, props.associatedModels.subject, | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a reason we are adding an empty line here?
| * | ||
| * @param {Sample} inst - The newly-created instance | ||
| */ | ||
| afterCreate(inst /* , opts */) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we test for whether a sample is published on realtime create and delete?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is another story for this.
|
@annyhe Can you merge this PR? |
No description provided.