Sectionen im Home hinzugefügt

This commit is contained in:
2023-11-15 21:30:45 +01:00
parent eac3fd9a9b
commit 57b217793d
5 changed files with 78 additions and 31 deletions

View 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
}

View File

@@ -13,6 +13,7 @@ func RegisterSeeders(db *gorm.DB) []Seeder {
return []Seeder{
{Seeder: fakers.UserFaker(db)},
{Seeder: fakers.ProductFaker(db)},
{Seeder: fakers.SectionFaker(db)},
}
}