removed all ocurences of GameSystem: "midgard"
This commit is contained in:
@@ -174,12 +174,11 @@ func (stamm *Skill) Create() error {
|
||||
return err
|
||||
}
|
||||
|
||||
func (stamm *Skill) First(name string) error {
|
||||
func (stamm *Skill) FirstwGS(name string, gameSystemId uint) error {
|
||||
if name == "" {
|
||||
return fmt.Errorf("name cannot be empty")
|
||||
}
|
||||
gs := GetGameSystem(stamm.GameSystemId, stamm.GameSystem)
|
||||
// Order by ID to get the record with the lowest ID when multiple categories exist
|
||||
gs := GetGameSystem(gameSystemId, stamm.GameSystem)
|
||||
err := database.DB.Where("(game_system=? OR game_system_id=?) AND name = ?", gs.Name, gs.ID, name).Order("id ASC").First(&stamm).Error
|
||||
if err != nil {
|
||||
// Fertigkeit found
|
||||
@@ -188,6 +187,14 @@ func (stamm *Skill) First(name string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (stamm *Skill) First(name string) error {
|
||||
if name == "" {
|
||||
return fmt.Errorf("name cannot be empty")
|
||||
}
|
||||
gs := GetGameSystem(stamm.GameSystemId, stamm.GameSystem)
|
||||
return stamm.FirstwGS(name, gs.ID)
|
||||
}
|
||||
|
||||
func (object *Skill) FirstId(value uint) error {
|
||||
gs := GetGameSystem(object.GameSystemId, object.GameSystem)
|
||||
err := database.DB.First(&object, "(game_system=? OR game_system_id=?) AND id = ?", gs.Name, gs.ID, value).Error
|
||||
@@ -349,11 +356,11 @@ func (stamm *Spell) Create() error {
|
||||
return err
|
||||
}
|
||||
|
||||
func (stamm *Spell) First(name string) error {
|
||||
func (stamm *Spell) FirstwGS(name string, gameSystemId uint) error {
|
||||
if name == "" {
|
||||
return fmt.Errorf("name cannot be empty")
|
||||
}
|
||||
gs := GetGameSystem(stamm.GameSystemId, stamm.GameSystem)
|
||||
gs := GetGameSystem(gameSystemId, stamm.GameSystem)
|
||||
err := database.DB.First(&stamm, "(game_system=? OR game_system_id=?) AND name = ?", gs.Name, gs.ID, name).Error
|
||||
if err != nil {
|
||||
// zauber found
|
||||
@@ -362,6 +369,14 @@ func (stamm *Spell) First(name string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (stamm *Spell) First(name string) error {
|
||||
if name == "" {
|
||||
return fmt.Errorf("name cannot be empty")
|
||||
}
|
||||
gs := GetGameSystem(stamm.GameSystemId, stamm.GameSystem)
|
||||
return stamm.FirstwGS(name, gs.ID)
|
||||
}
|
||||
|
||||
func (object *Spell) FirstId(value uint) error {
|
||||
gs := GetGameSystem(object.GameSystemId, object.GameSystem)
|
||||
err := database.DB.First(&object, "(game_system=? OR game_system_id=?) AND id = ?", gs.Name, gs.ID, value).Error
|
||||
|
||||
Reference in New Issue
Block a user