Refactor code

pull/141/head
wenxu12345 3 years ago
parent 77bb88ed59
commit 109e8b53a1

@ -82,7 +82,7 @@ func InsertFriendApplication(friendRequest *db.FriendRequest) error {
return nil return nil
} }
t := dbConn.Debug().Table("friend_requests").Select("*").Updates(*friendRequest) t := dbConn.Debug().Table("friend_requests").Where("from_user_id = ? and to_user_id = ?", friendRequest.FromUserID, friendRequest.ToUserID).Select("*").Updates(*friendRequest)
if t.RowsAffected == 0 { if t.RowsAffected == 0 {
return utils.Wrap(errors.New("RowsAffected == 0"), "no update") return utils.Wrap(errors.New("RowsAffected == 0"), "no update")
} }

Loading…
Cancel
Save