1
0
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:
Scott Bishel 2022-08-10 08:17:36 -06:00 committed by GitHub
parent f310ccf254
commit ba7e453bde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {