[MM-28985] Remove pointers to slice (part 1) (#18034)
* Remove pointers to slice (part 1) * Remove use of pointers to slice from model package (#18045) * Fix after merge
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
132f114793
Коммит
04b27ce93c
@@ -1235,19 +1235,18 @@ func (a *App) LeaveTeam(c *request.Context, team *model.Team, user *model.User,
|
||||
return model.NewAppError("LeaveTeam", "api.team.remove_user_from_team.missing.app_error", nil, err.Error(), http.StatusBadRequest)
|
||||
}
|
||||
|
||||
var channelList *model.ChannelList
|
||||
|
||||
var channelList model.ChannelList
|
||||
var nErr error
|
||||
if channelList, nErr = a.Srv().Store.Channel().GetChannels(team.Id, user.Id, true, 0); nErr != nil {
|
||||
var nfErr *store.ErrNotFound
|
||||
if errors.As(nErr, &nfErr) {
|
||||
channelList = &model.ChannelList{}
|
||||
channelList = model.ChannelList{}
|
||||
} else {
|
||||
return model.NewAppError("LeaveTeam", "app.channel.get_channels.get.app_error", nil, nErr.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
}
|
||||
|
||||
for _, channel := range *channelList {
|
||||
for _, channel := range channelList {
|
||||
if !channel.IsGroupOrDirect() {
|
||||
a.invalidateCacheForChannelMembers(channel.Id)
|
||||
if nErr = a.Srv().Store.Channel().RemoveMember(channel.Id, user.Id); nErr != nil {
|
||||
@@ -1739,7 +1738,7 @@ func (a *App) PermanentDeleteTeam(team *model.Team) *model.AppError {
|
||||
return model.NewAppError("PermanentDeleteTeam", "app.channel.get_channels.get.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
} else {
|
||||
for _, c := range *channels {
|
||||
for _, c := range channels {
|
||||
a.PermanentDeleteChannel(c)
|
||||
}
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user