feat: allow to find users with access to a project more freely
Related to https://kolaente.dev/vikunja/frontend/issues/2196
This commit is contained in:
@ -22,7 +22,7 @@ import (
|
||||
)
|
||||
|
||||
// ILIKE returns an ILIKE query on postgres and a LIKE query on all other platforms.
|
||||
// Postgres' is case sensitive by default.
|
||||
// Postgres' is case-sensitive by default.
|
||||
// To work around this, we're using ILIKE as opposed to normal LIKE statements.
|
||||
// ILIKE is preferred over LOWER(text) LIKE for performance reasons.
|
||||
// See https://stackoverflow.com/q/7005302/10924593
|
||||
@ -31,5 +31,9 @@ func ILIKE(column, search string) builder.Cond {
|
||||
return builder.Expr(column+" ILIKE ?", "%"+search+"%")
|
||||
}
|
||||
|
||||
if Type() == schemas.SQLITE {
|
||||
return builder.Expr("username = ? COLLATE NOCASE", "%"+search+"%")
|
||||
}
|
||||
|
||||
return &builder.Like{column, "%" + search + "%"}
|
||||
}
|
||||
|
Reference in New Issue
Block a user