fix: create and get news
This commit is contained in:
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user