feat: add a new command - group unset channel-losses/channel-gains
All checks were successful
continuous-integration/drone/pr Build is passing

This commit is contained in:
Dawid Wysokiński 2022-10-11 07:24:48 +02:00
parent 26fc3ea71d
commit 3bfb3a40f7
Signed by: Kichiyaki
GPG Key ID: B5445E357FB8B892

View File

@ -90,11 +90,19 @@ type updateGroupsParamsApplier struct {
func (u updateGroupsParamsApplier) apply(q *bun.UpdateQuery) *bun.UpdateQuery {
if u.params.ChannelGains.Valid {
q = q.Set("channel_gains = ?", u.params.ChannelGains.String)
if u.params.ChannelGains.String != "" {
q = q.Set("channel_gains = ?", u.params.ChannelGains.String)
} else {
q = q.Set("channel_gains = NULL")
}
}
if u.params.ChannelLosses.Valid {
q = q.Set("channel_losses = ?", u.params.ChannelLosses.String)
if u.params.ChannelLosses.String != "" {
q = q.Set("channel_losses = ?", u.params.ChannelLosses.String)
} else {
q = q.Set("channel_losses = NULL")
}
}
if u.params.ServerKey.Valid {