ref: use username for search

This commit is contained in:
Steve Korshakov 2025-09-19 21:02:50 -07:00
parent 9e73fea852
commit 0d46e6fee3

View File

@ -93,17 +93,10 @@ export async function userRoutes(app: Fastify) {
// Search for user by username or GitHub login // Search for user by username or GitHub login
const user = await db.account.findFirst({ const user = await db.account.findFirst({
where: { where: {
OR: [ username: {
{ username: query }, startsWith: query,
{ mode: 'insensitive'
githubUser: { }
profile: {
path: ['login'],
equals: query
}
}
}
]
}, },
include: { include: {
githubUser: true githubUser: true