修复了一些问题
This commit is contained in:
@@ -310,6 +310,7 @@ func UpdateContactHandler(c *gin.Context) {
|
||||
GroupID uint `json:"group_id"`
|
||||
IsTop *bool `json:"is_top"`
|
||||
IsMuted *bool `json:"is_muted"`
|
||||
IsBlocked *bool `json:"is_blocked"`
|
||||
}
|
||||
|
||||
if err := c.ShouldBindJSON(&req); err != nil {
|
||||
@@ -330,6 +331,9 @@ func UpdateContactHandler(c *gin.Context) {
|
||||
if req.IsMuted != nil {
|
||||
updates["is_muted"] = *req.IsMuted
|
||||
}
|
||||
if req.IsBlocked != nil {
|
||||
updates["is_blocked"] = *req.IsBlocked
|
||||
}
|
||||
|
||||
if err := service.ContactSvc.UpdateContact(userID.(string), contactID, updates); err != nil {
|
||||
utils.BadRequest(c, "更新失败: "+err.Error())
|
||||
|
||||
Reference in New Issue
Block a user