Changeset 0.31.2 (#205)

This commit is contained in:
2026-03-19 13:29:27 +00:00
parent 8364440081
commit 6668e546fe
25 changed files with 1357 additions and 50 deletions

View File

@@ -105,6 +105,7 @@ func (h *TeamHandler) CreateTeam(c *gin.Context) {
team := &models.Team{
Name: req.Name,
Slug: slugify(req.Name),
Description: req.Description,
CreatedBy: adminID,
IsActive: true,
@@ -118,7 +119,7 @@ func (h *TeamHandler) CreateTeam(c *gin.Context) {
return
}
c.JSON(http.StatusCreated, gin.H{"id": team.ID, "name": team.Name})
c.JSON(http.StatusCreated, gin.H{"id": team.ID, "name": team.Name, "slug": team.Slug})
AuditLog(h.stores.Audit, c, "team.create", "team", team.ID, map[string]interface{}{"name": team.Name})
}
@@ -155,6 +156,7 @@ func (h *TeamHandler) UpdateTeam(c *gin.Context) {
fields := map[string]interface{}{}
if req.Name != nil {
fields["name"] = *req.Name
fields["slug"] = slugify(*req.Name)
}
if req.Description != nil {
fields["description"] = *req.Description