Changeset 0.28.0.4 (#176)
This commit is contained in:
@@ -120,7 +120,7 @@ func (h *TeamHandler) CreateTeam(c *gin.Context) {
|
||||
}
|
||||
|
||||
c.JSON(http.StatusCreated, gin.H{"id": team.ID, "name": team.Name})
|
||||
AuditLog(c, "team.create", "team", team.ID, map[string]interface{}{"name": team.Name})
|
||||
AuditLog(h.stores.Audit, c, "team.create", "team", team.ID, map[string]interface{}{"name": team.Name})
|
||||
}
|
||||
|
||||
// ── Admin: Get Team ─────────────────────────
|
||||
@@ -217,7 +217,7 @@ func (h *TeamHandler) UpdateTeam(c *gin.Context) {
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{"ok": true})
|
||||
AuditLog(c, "team.update", "team", teamID, nil)
|
||||
AuditLog(h.stores.Audit, c, "team.update", "team", teamID, nil)
|
||||
}
|
||||
|
||||
// ── Admin: Delete Team ──────────────────────
|
||||
@@ -242,7 +242,7 @@ func (h *TeamHandler) DeleteTeam(c *gin.Context) {
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{"ok": true})
|
||||
AuditLog(c, "team.delete", "team", teamID, nil)
|
||||
AuditLog(h.stores.Audit, c, "team.delete", "team", teamID, nil)
|
||||
}
|
||||
|
||||
// ── Members: List ───────────────────────────
|
||||
@@ -303,7 +303,7 @@ func (h *TeamHandler) AddMember(c *gin.Context) {
|
||||
}
|
||||
|
||||
c.JSON(http.StatusCreated, gin.H{"id": id})
|
||||
AuditLog(c, "team.add_member", "team", getTeamID(c), map[string]interface{}{
|
||||
AuditLog(h.stores.Audit, c, "team.add_member", "team", getTeamID(c), map[string]interface{}{
|
||||
"user_id": req.UserID, "role": req.Role,
|
||||
})
|
||||
}
|
||||
@@ -333,7 +333,7 @@ func (h *TeamHandler) UpdateMember(c *gin.Context) {
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{"ok": true})
|
||||
AuditLog(c, "team.update_member", "team", getTeamID(c), map[string]interface{}{
|
||||
AuditLog(h.stores.Audit, c, "team.update_member", "team", getTeamID(c), map[string]interface{}{
|
||||
"member_id": memberID, "role": req.Role,
|
||||
})
|
||||
}
|
||||
@@ -355,7 +355,7 @@ func (h *TeamHandler) RemoveMember(c *gin.Context) {
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{"ok": true})
|
||||
AuditLog(c, "team.remove_member", "team", getTeamID(c), map[string]interface{}{
|
||||
AuditLog(h.stores.Audit, c, "team.remove_member", "team", getTeamID(c), map[string]interface{}{
|
||||
"member_id": memberID,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user