Fix lint: rename shadowed variables in user model
- findUserByUsername: use imported sql directly instead of destructuring it from the callback (shadowed the top-level import) - findUsersPaginated: rename orderBy callback param from users to t (shadowed the outer users result variable) https://claude.ai/code/session_01E4UUQqQedhFP2F5YcBRArs
This commit is contained in:
parent
a45a8619b1
commit
95f65e6b83
1 changed files with 2 additions and 2 deletions
|
|
@ -43,7 +43,7 @@ export async function findUsersByIds(ids: string[]): Promise<User[]> {
|
|||
export async function findUserByUsername(username: string): Promise<User | undefined> {
|
||||
const db = database();
|
||||
return await db.query.users.findFirst({
|
||||
where: (users, { sql }) => sql`lower(${users.username}) = lower(${username})`,
|
||||
where: (u) => sql`lower(${u.username}) = lower(${username})`,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -128,7 +128,7 @@ export async function findUsersPaginated(options: {
|
|||
const [users, [{ count }]] = await Promise.all([
|
||||
db.query.users.findMany({
|
||||
where: filter,
|
||||
orderBy: (users, { asc }) => [asc(users.displayName)],
|
||||
orderBy: (t, { asc }) => [asc(t.displayName)],
|
||||
limit: options.limit,
|
||||
offset: options.offset,
|
||||
}),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue