MM-21118: Use querybuilder instead of fmt.Sprintf in channelStore (#13385)
* MM-21118: Use querybuilder instead of fmt.Sprintf in channelStore We use the querybuilder API instead of just building the query string manually using fmt.Sprintf * Replaced comma with colon
Этот коммит содержится в:
коммит произвёл
Jesús Espino
родитель
de0672937c
Коммит
0e6f0cfbd6
@@ -960,7 +960,7 @@ func (s SqlChannelStore) getAllChannelsQuery(opts store.ChannelSearchOpts, forCo
|
||||
}
|
||||
|
||||
if len(opts.ExcludeChannelNames) > 0 {
|
||||
query = query.Where(fmt.Sprintf("c.Name NOT IN ('%s')", strings.Join(opts.ExcludeChannelNames, "', '")))
|
||||
query = query.Where(sq.NotEq{"c.Name": opts.ExcludeChannelNames})
|
||||
}
|
||||
|
||||
return query
|
||||
@@ -2265,7 +2265,7 @@ func (s SqlChannelStore) channelSearchQuery(term string, opts store.ChannelSearc
|
||||
}
|
||||
|
||||
if len(opts.ExcludeChannelNames) > 0 {
|
||||
query = query.Where(fmt.Sprintf("c.Name NOT IN ('%s')", strings.Join(opts.ExcludeChannelNames, "', '")))
|
||||
query = query.Where(sq.NotEq{"c.Name": opts.ExcludeChannelNames})
|
||||
}
|
||||
|
||||
if len(opts.NotAssociatedToGroup) > 0 {
|
||||
|
||||
Ссылка в новой задаче
Block a user