Skip to content
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

Filter partial update fix #273

Merged
merged 2 commits into from
Oct 19, 2020

Conversation

louis-lau
Copy link
Member

Calling {put} /users/:user/filters/:filter without either query or action produced an error similar to these.

{
  "error": "Cannot use 'in' operator to search for 'seen' in undefined"
}

Wrapped the existing logic in some checks for query and action. Also changed error: 'No changes' to success: true. IMO if you ask for no changes, and then no changes are performed, that's a success.

The github diff doesn't seem to like showing indentation changes very clearly it seems. 😉

@andris9 andris9 merged commit 961111a into nodemailer:master Oct 19, 2020
@andris9
Copy link
Member

andris9 commented Oct 19, 2020

That was one confusing diff. Now that I look at the code I see the mistake. I thought that by applying .default({}) to the query object in the input processing step would ensure that there is always a query object available but I was not using only the validation result but the original input as well. And the "no changes" error response had a specific reason but I don't remember what the reason was anymore, so I guess there is no reason.

@louis-lau
Copy link
Member Author

Ahh, makes sense. Yeah not sure what's up with the diff hahaha, hiding whitespace changes helps. Cheers!

@louis-lau louis-lau deleted the filter-partial-update-fix branch October 19, 2020 09:33
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.

2 participants