mirror of
https://github.com/lejianwen/rustdesk-api.git
synced 2025-09-15 14:28:34 +08:00
fix bug #27
This commit is contained in:
parent
90b9b5adba
commit
642351dafd
@ -234,7 +234,7 @@ func (ct *AddressBook) Update(c *gin.Context) {
|
||||
response.Fail(c, 101, response.TranslateMsg(c, "ParamsError"))
|
||||
return
|
||||
}
|
||||
err := service.AllService.AddressBookService.Update(t)
|
||||
err := service.AllService.AddressBookService.UpdateAll(t)
|
||||
if err != nil {
|
||||
response.Fail(c, 101, response.TranslateMsg(c, "OperationFailed")+err.Error())
|
||||
return
|
||||
|
||||
@ -127,6 +127,11 @@ func (s *AddressBookService) Delete(u *model.AddressBook) error {
|
||||
|
||||
// Update 更新
|
||||
func (s *AddressBookService) Update(u *model.AddressBook) error {
|
||||
return global.DB.Model(u).Updates(u).Error
|
||||
}
|
||||
|
||||
// UpdateAll 更新
|
||||
func (s *AddressBookService) UpdateAll(u *model.AddressBook) error {
|
||||
return global.DB.Model(u).Select("*").Omit("created_at").Updates(u).Error
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user