returns empty array instead null

This commit is contained in:
dhax 2017-10-11 12:35:00 +02:00
parent da481e9933
commit f4046cb178

View file

@ -27,7 +27,7 @@ func NewAdmAccountStore(db *pg.DB) *AdmAccountStore {
// List applies a filter and returns paginated array of matching results and total count. // List applies a filter and returns paginated array of matching results and total count.
func (s *AdmAccountStore) List(f auth.AccountFilter) (*[]auth.Account, int, error) { func (s *AdmAccountStore) List(f auth.AccountFilter) (*[]auth.Account, int, error) {
var a []auth.Account a := []auth.Account{}
count, err := s.db.Model(&a). count, err := s.db.Model(&a).
Apply(f.Filter). Apply(f.Filter).
SelectAndCount() SelectAndCount()