Sectionen im Home hinzugefügt
This commit is contained in:
26
database/fakers/section_faker.go
Normal file
26
database/fakers/section_faker.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package fakers
|
||||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
"gorm.io/gorm"
|
||||
"moretcgshop/app/models"
|
||||
"time"
|
||||
)
|
||||
|
||||
func SectionFaker(db *gorm.DB) []*models.Section {
|
||||
var res []*models.Section
|
||||
|
||||
var temp *models.Section
|
||||
var games []string = []string{"One-Piece", "Yu-Gi-Oh", "My Little Pony"}
|
||||
|
||||
for _, game := range games {
|
||||
temp = &models.Section{
|
||||
ID: uuid.New().String(),
|
||||
Name: game,
|
||||
CreatedAt: time.Time{},
|
||||
UpdatedAt: time.Time{},
|
||||
}
|
||||
res = append(res, temp)
|
||||
}
|
||||
return res
|
||||
}
|
||||
@@ -13,6 +13,7 @@ func RegisterSeeders(db *gorm.DB) []Seeder {
|
||||
return []Seeder{
|
||||
{Seeder: fakers.UserFaker(db)},
|
||||
{Seeder: fakers.ProductFaker(db)},
|
||||
{Seeder: fakers.SectionFaker(db)},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user