MM-40594: Fix nil retention policies (#19285)

Due to the store method having named returns, the variable
was getting set to nil instead of being an empty slice.
We missed this during code review.

https://mattermost.atlassian.net/browse/MM-40594

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2022-01-06 12:30:01 +05:30
коммит произвёл GitHub
родитель 9ba020db2e
Коммит 2f58c88f1b
2 изменённых файлов: 11 добавлений и 3 удалений

Просмотреть файл

@@ -419,13 +419,14 @@ func (s *SqlRetentionPolicyStore) Get(id string) (*model.RetentionPolicyWithTeam
return &policy, nil
}
func (s *SqlRetentionPolicyStore) GetAll(offset, limit int) (policies []*model.RetentionPolicyWithTeamAndChannelCounts, err error) {
func (s *SqlRetentionPolicyStore) GetAll(offset, limit int) ([]*model.RetentionPolicyWithTeamAndChannelCounts, error) {
policies := []*model.RetentionPolicyWithTeamAndChannelCounts{}
queryString, args, err := s.buildGetPoliciesQuery("", offset, limit)
if err != nil {
return
return policies, err
}
err = s.GetReplicaX().Select(&policies, queryString, args...)
return
return policies, err
}
func (s *SqlRetentionPolicyStore) GetCount() (int64, error) {