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

bug in mappers logic when using middleware #13

Open
AmadoGuerrero opened this issue Oct 9, 2020 · 1 comment
Open

bug in mappers logic when using middleware #13

AmadoGuerrero opened this issue Oct 9, 2020 · 1 comment

Comments

@AmadoGuerrero
Copy link

If you don't use middleware, there is no problem, the mappers work fine.
But if you decide to use middlware to verify if the projectId is valid (like I did) you will run across a bug because the projectToBody mapper function will get called twice. (Once when checking the id, and another when returning the updated field). so when intToBoolean runs the second time, it will be comparing true/false to 1 and that will always be false (even if the action has been completed). I had to change line 9 in mappers.js from return int === 1 ? true : false; to return int === 1 || int === true ? true : false; for it to work for me.

@DrSumner
Copy link

DrSumner commented Jul 9, 2024

Im having this same problem, and came to this same conclusion but wasn't sure if id be allowed to change it. Ill go ahead and make that same change so I can be done with this. hopefully, they patch that. the intToBoolean is too strict IMO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants