Skip to content

Commit 09444ac

Browse files
authored
cleanup the frontegg view (#2019)
1 parent 64a6f0d commit 09444ac

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

backend/controllers/orgs.go

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -85,26 +85,6 @@ func UpdateOrgSettingsApi(c *gin.Context) {
8585

8686
c.JSON(http.StatusOK, gin.H{})
8787
}
88-
func CreateFronteggOrgFromWebhook(c *gin.Context) {
89-
var json TenantCreatedEvent
90-
91-
if err := c.ShouldBindJSON(&json); err != nil {
92-
slog.Error("Failed to bind JSON", "error", err)
93-
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
94-
return
95-
}
96-
source := c.GetHeader("x-tenant-source")
97-
98-
org, err := models.DB.CreateOrganisation(json.Name, source, json.TenantId)
99-
if err != nil {
100-
slog.Error("Failed to create organisation", "tenantId", json.TenantId, "name", json.Name, "source", source, "error", err)
101-
c.JSON(http.StatusInternalServerError, gin.H{"error": "Failed to create organisation"})
102-
return
103-
}
104-
105-
slog.Info("Successfully created organisation from webhook", "tenantId", json.TenantId, "name", json.Name, "orgId", org.ID)
106-
c.JSON(http.StatusOK, gin.H{"success": true})
107-
}
10888

10989
func AssociateTenantIdToDiggerOrg(c *gin.Context) {
11090
authHeader := c.Request.Header.Get("Authorization")

0 commit comments

Comments
 (0)