From the course: Next.js Ecommerce: Build a Shopping Platform from Scratch

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Admin users search

Admin users search

So now we want to search products and orders. And it's going to be the same thing. So I actually kept the order actions and order page open. And let's open the user action. And we want to go to the get all users, which is, let's see, just search get all. OK, so get all users is going to take in a query. And we'll add query. The type is going to be a string. And then right above data, we want to add the filter, just like we did here in the order actions. In fact, I'll just copy this, and let's paste that in here. And then Prisma has to be brought in from Prisma Client. And let's see, what we want to search, though, is not in use. We do want the name, but this is the user action in the user table, so we don't want to include that. So we can get rid of the user that wraps name. And then we can just put name right in here. And yeah, that should work. Why is this not assignable to O? So here, we don't want to use order where input. We want to use user where input. OK, and then we're just…

Contents