mirror of
https://github.com/getAlby/hub.git
synced 2026-08-13 12:33:39 +02:00
fix: case sensitive search in postgres (#1801)
This commit is contained in:
parent
1ebd8e19cb
commit
0d28c0d429
1 changed files with 6 additions and 1 deletions
|
|
@ -405,7 +405,12 @@ func (api *api) ListApps(limit uint64, offset uint64, filters ListAppsFilters, o
|
|||
|
||||
if filters.Name != "" {
|
||||
// searching for "Damus" will return "Damus" and "Damus (1)"
|
||||
query = query.Where("name LIKE ?", filters.Name+"%")
|
||||
// Use case-insensitive search for both SQLite and PostgreSQL
|
||||
if api.db.Dialector.Name() == "postgres" {
|
||||
query = query.Where("name ILIKE ?", filters.Name+"%")
|
||||
} else {
|
||||
query = query.Where("name LIKE ?", filters.Name+"%")
|
||||
}
|
||||
}
|
||||
|
||||
if filters.AppStoreAppId != "" {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue