fix: create and get news

This commit is contained in:
ericprd
2025-03-05 22:15:39 +08:00
parent dd109c8aa0
commit 5c699dfa53
22 changed files with 46 additions and 159 deletions
-15
View File
@@ -1,15 +0,0 @@
package categoryrepository
import (
"legalgo-BE-go/database"
)
func (a *accessor) GetByIDs(ids []string) ([]database.Category, error) {
var categories []database.Category
if err := a.DB.Find(&categories, "id IN ?", ids).Error; err != nil {
return nil, err
}
return categories, nil
}
+15
View File
@@ -0,0 +1,15 @@
package categoryrepository
import (
categorydomain "legalgo-BE-go/internal/domain/category"
)
func (a *accessor) GetByIDs(ids []string) ([]categorydomain.Category, error) {
var categories []categorydomain.Category
if err := a.DB.Find(&categories, "id IN ?", ids).Error; err != nil {
return nil, err
}
return categories, nil
}
+1 -1
View File
@@ -14,7 +14,7 @@ type Category interface {
Update(categorydomain.Category) error
GetAllModel() ([]categorydomain.Category, error)
GetByIDs([]string) ([]database.Category, error)
GetByIDs([]string) ([]categorydomain.Category, error)
}
func New(