ref: use username for search
This commit is contained in:
parent
9e73fea852
commit
0d46e6fee3
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user