package newsrepository

import (
	"fmt"
	"legalgo-BE-go/database"
)

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