Skip to content

Conversation

@samparsky
Copy link
Contributor

Fix query

@samparsky samparsky changed the title Fix price alert WIP Fix price alert Apr 19, 2018
Copy link
Member

@esco esco left a 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

userId = new ObjectID(userId)

const query = (fsym) ? {where: {fsym, userId}} : {where: {userId}}
console.log('query', query)
Copy link
Member

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


Alert.fetchAll = async function(access_token, {fsym}=data, cb) {
let err = null
if (!access_token || !access_token.userId) {
Copy link
Member

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


Alert.disable = async function(accessToken, {alertId}=data, cb){
let err = null
if (!accessToken || !accessToken.userId) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$owner


Alert.enable = async function(accessToken, {alertId}=data, cb){
let err = null
if (!accessToken || !accessToken.userId) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$owner

@samparsky samparsky changed the title WIP Fix price alert Fix price alert Apr 23, 2018
@samparsky samparsky force-pushed the fix-price-alert branch 3 times, most recently from 17e47b9 to 44f1258 Compare April 25, 2018 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants