Changeset 0.28.0.4 (#176)

This commit is contained in:
2026-03-12 12:12:17 +00:00
parent f5171d3bd3
commit 52bd36ba48
16 changed files with 520 additions and 292 deletions

View File

@@ -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,
})
}