package newsrepository

import (
	"fmt"
	newsdomain "legalgo-BE-go/internal/domain/news"
)

func (a *accessor) Create(spec newsdomain.News) error {
	if err := a.db.Create(&spec).Error; err != nil {
		return fmt.Errorf("failed to create news: %w", err)
	}
	return nil
}
