mirror of
https://github.com/mattermost/focalboard.git
synced 2025-01-08 15:06:08 +02:00
GH-3621- Make query case insensitive (#3623)
* make check case insensitive * Fixed a server lint Co-authored-by: Harshil Sharma <harshilsharma63@gmail.com>
This commit is contained in:
parent
f310ccf254
commit
ba7e453bde
@ -826,13 +826,14 @@ func (s *MattermostAuthLayer) SearchUserChannels(teamID, userID, query string) (
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
lowerQuery := strings.ToLower(query)
|
||||
|
||||
result := []*mmModel.Channel{}
|
||||
count := 0
|
||||
for _, channel := range channels {
|
||||
if channel.Type != mmModel.ChannelTypeDirect &&
|
||||
channel.Type != mmModel.ChannelTypeGroup &&
|
||||
(strings.Contains(channel.Name, query) || strings.Contains(channel.DisplayName, query)) {
|
||||
(strings.Contains(strings.ToLower(channel.Name), lowerQuery) || strings.Contains(strings.ToLower(channel.DisplayName), lowerQuery)) {
|
||||
result = append(result, channel)
|
||||
count++
|
||||
if count >= 10 {
|
||||
|
Loading…
Reference in New Issue
Block a user