Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 fix: fix fields where channels can't save null characters(lobehub#103)
Browse files Browse the repository at this point in the history
MartialBE committed Mar 13, 2024

Unverified

No user is associated with the committer email.
1 parent 7ac3a85 commit 0b62ffa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions model/channel.go
Original file line number Diff line number Diff line change
@@ -107,7 +107,7 @@ func GetChannelById(id int, selectAll bool) (*Channel, error) {

func BatchInsertChannels(channels []Channel) error {
var err error
err = DB.Create(&channels).Error
err = DB.Omit("UsedQuota").Create(&channels).Error
if err != nil {
return err
}
@@ -182,7 +182,7 @@ func (channel *Channel) GetModelMapping() string {

func (channel *Channel) Insert() error {
var err error
err = DB.Create(channel).Error
err = DB.Omit("UsedQuota").Create(channel).Error
if err != nil {
return err
}
@@ -192,7 +192,7 @@ func (channel *Channel) Insert() error {

func (channel *Channel) Update() error {
var err error
err = DB.Model(channel).Updates(channel).Error
err = DB.Model(channel).Select("*").Omit("UsedQuota").Updates(channel).Error
if err != nil {
return err
}

0 comments on commit 0b62ffa

Please sign in to comment.