mirror of
https://github.com/mattermost/focalboard.git
synced 2025-01-26 18:48:15 +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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
lowerQuery := strings.ToLower(query)
|
||||||
|
|
||||||
result := []*mmModel.Channel{}
|
result := []*mmModel.Channel{}
|
||||||
count := 0
|
count := 0
|
||||||
for _, channel := range channels {
|
for _, channel := range channels {
|
||||||
if channel.Type != mmModel.ChannelTypeDirect &&
|
if channel.Type != mmModel.ChannelTypeDirect &&
|
||||||
channel.Type != mmModel.ChannelTypeGroup &&
|
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)
|
result = append(result, channel)
|
||||||
count++
|
count++
|
||||||
if count >= 10 {
|
if count >= 10 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user