mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-12 04:55:59 +08:00
Refactor code
This commit is contained in:
@@ -27,13 +27,7 @@ func UpdateGroupRequest(groupRequest GroupRequest) error {
|
||||
if groupRequest.HandledTime.Unix() < 0 {
|
||||
groupRequest.HandledTime = utils.UnixSecondToTime(0)
|
||||
}
|
||||
t := dbConn.Table("group_request").Where("group_id=? and user_id=?", groupRequest.GroupID, groupRequest.UserID).Update(&groupRequest)
|
||||
//RowsAffected
|
||||
if t.RowsAffected == 0 {
|
||||
return InsertIntoGroupRequest(groupRequest)
|
||||
} else {
|
||||
return t.Error
|
||||
}
|
||||
return dbConn.Table("group_request").Where("group_id=? and user_id=?", groupRequest.GroupID, groupRequest.UserID).Update(&groupRequest).Error
|
||||
}
|
||||
|
||||
func InsertIntoGroupRequest(toInsertInfo GroupRequest) error {
|
||||
|
||||
Reference in New Issue
Block a user