TypeError when using and() in where()
I am trying to update based on two conditions. As far as I understand the docs, this should work, but I am getting a TypeError that I just can't get my head around. The code is even working, but since there is the TypeError, I can't build a production bundle.
Consider this piece of code:
See the Screenshot for the TS Errpr. The problematic part seems to be the second
eq:
Any idea what I'm missing here?
3 Replies
apps.user is not nullable and user.userId is string | null. Recommendation would be to throw or return early if user.userId is null, then type narrowing will ensure only string is passed to the query.Oh boy. Thanks a lot, that's it. Guess what, all other actions have an early return for that case, didn't see the difference 😆
Yeah, that error is due to a type mismatch between the column and the input.