refactor: Simplify user query to filter by isSuspended boolean instead of status string.
This commit is contained in:
@@ -22,7 +22,7 @@ export async function GET(request: NextRequest) {
|
|||||||
createdAt: users.createdAt,
|
createdAt: users.createdAt,
|
||||||
})
|
})
|
||||||
.from(users)
|
.from(users)
|
||||||
.where(sql`${users.status} IS NULL OR ${users.status} != 'suspended'`)
|
.where(sql`${users.isSuspended} IS FALSE`)
|
||||||
.orderBy(desc(users.createdAt))
|
.orderBy(desc(users.createdAt))
|
||||||
.limit(limit);
|
.limit(limit);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user