mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00
fix update of input and output length upon adding signals
This commit is contained in:
parent
6c8b55469f
commit
cea6149b39
1 changed files with 4 additions and 4 deletions
|
@ -67,8 +67,8 @@ func (s *Signal) addToConfig() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// adapt length of mapping
|
// adapt length of mapping
|
||||||
var newInputLength = db.Model(m).Where("Direction = ?", "in").Association("InputMapping").Count()
|
var newInputLength = db.Model(&m).Where("Direction = ?", "in").Association("InputMapping").Count()
|
||||||
err = db.Model(m).Update("InputLength", newInputLength).Error
|
err = db.Model(&m).Update("InputLength", newInputLength).Error
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
err = db.Model(&m).Association("OutputMapping").Append(s).Error
|
err = db.Model(&m).Association("OutputMapping").Append(s).Error
|
||||||
|
@ -77,8 +77,8 @@ func (s *Signal) addToConfig() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// adapt length of mapping
|
// adapt length of mapping
|
||||||
var newOutputLength = db.Model(m).Where("Direction = ?", "out").Association("OutputMapping").Count()
|
var newOutputLength = db.Model(&m).Where("Direction = ?", "out").Association("OutputMapping").Count()
|
||||||
err = db.Model(m).Update("OutputLength", newOutputLength).Error
|
err = db.Model(&m).Update("OutputLength", newOutputLength).Error
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue