package newsrepository

import newsdomain "legalgo-BE-go/internal/domain/news"

func (a *accessor) GetAll() ([]newsdomain.News, error) {
	var news []newsdomain.News

	if err := a.db.
		Preload("Tags").
		Preload("Categories").
		Preload("Author").
		Find(&news).Error; err != nil {
		return nil, err
	}

	return news, nil
}
