-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix price alert #100
base: master
Are you sure you want to change the base?
Fix price alert #100
Conversation
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.
looking good so far, just a few changes
server/models/alert.js
Outdated
userId = new ObjectID(userId) | ||
|
||
const query = (fsym) ? {where: {fsym, userId}} : {where: {userId}} | ||
console.log('query', query) |
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.
protip: console.log({ query })
for faster debugging
server/models/alert.js
Outdated
|
||
Alert.fetchAll = async function(access_token, {fsym}=data, cb) { | ||
let err = null | ||
if (!access_token || !access_token.userId) { |
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.
Why not use the ACL json for $owner
? Owner checks to see if the userId passed in the url is the same as the one on the accesstoken
server/models/alert.js
Outdated
|
||
Alert.disable = async function(accessToken, {alertId}=data, cb){ | ||
let err = null | ||
if (!accessToken || !accessToken.userId) { |
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.
$owner
server/models/alert.js
Outdated
|
||
Alert.enable = async function(accessToken, {alertId}=data, cb){ | ||
let err = null | ||
if (!accessToken || !accessToken.userId) { |
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.
$owner
da882bc
to
27cbcb8
Compare
17e47b9
to
44f1258
Compare
…rice alerts, added acl definition
44f1258
to
aa5a1fd
Compare
Fix query