14 lines
269 B
Go
Raw Normal View History

2025-03-02 04:36:17 +08:00
package newsrepository
import (
"fmt"
newsdomain "legalgo-BE-go/internal/domain/news"
)
2025-03-05 22:15:39 +08:00
func (a *accessor) Create(spec newsdomain.News) error {
2025-03-02 04:36:17 +08:00
if err := a.db.Create(&spec).Error; err != nil {
return fmt.Errorf("failed to create news: %w", err)
}
return nil
}