Next.js Discord

Discord Forum

Drizzle selects throws and error

Answered
JChicano posted this in #help-forum
Open in Discord
Avatar
Hello, i have this query than combine two, when i launch the page the query works well, but in the code it throws this error, bcs the method "inArray" doenst allow a dinamic array, so i think i have to do another query with the same result to fix this, can some1 help me 😄
Image
Answered by JChicano
doing a method with all the situations, and calling it
Image
View full answer

19 Replies

Avatar
Image
if i put "const valores =['Ford', 'GM']", and i pass "valores", still not working, and this obviously cant be empty
and this is the documentation on this method, im using the second example, but there on the first query is not used "await"
Image
if i remove the "await" of the first query the error is fixed, but the query gives and empty array bcs the first one in not done when the second one is going to do, idk if im explaining well 😅
Image
Avatar
Can you try by creating a static array like const abc = ['item', 'item2'] as const?

Else, as I mentioned: share the error.
Avatar
@JChicano Click to see attachment
Avatar
this is the error
Avatar
@JChicano this is the error
Avatar
It looks more like a documentation…
I am looking for this one
Image
Avatar
its ok, i did a "patch" and its working so fuck it xd
Avatar
What’s your „patch“?
Avatar
doing a method with all the situations, and calling it
Image
Answer
Avatar
Image
and not the method "inArray" is working without errors bcs it recives the data manually
Avatar
Oh wow, that’s nasty code.. yea. Whatever. If you fine with that, then use it. By the way: it is easily possible to have an dynamic array for „inArray“ search
Avatar
i know and the way i have it worked well and it was easier, but with this way i dont have errors so is ok for me 😅
@B33fb0n3 Btw, do you know about how to enable a domain custom domain in vercel, that i have in cloudflare and do this aswell, bcs i not getting it :thinq:
Image