feat: add a new command - group unset channel-losses/channel-gains #14

Merged
Kichiyaki merged 2 commits from feat/new-commands-unset-channel-losses-gains into master 2022-10-11 05:29:42 +00:00
Showing only changes of commit 3bfb3a40f7 - Show all commits

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 {