diff --git a/backend/pkg/web/handler/source.go b/backend/pkg/web/handler/source.go index f46fe431..12e1b8f1 100644 --- a/backend/pkg/web/handler/source.go +++ b/backend/pkg/web/handler/source.go @@ -14,36 +14,6 @@ import ( "strings" ) -func CreateSource(c *gin.Context) { - logger := c.MustGet("LOGGER").(*logrus.Entry) - databaseRepo := c.MustGet("REPOSITORY").(database.DatabaseRepository) - - sourceCred := models.Source{} - if err := c.ShouldBindJSON(&sourceCred); err != nil { - logger.Errorln("An error occurred while parsing posted source credential", err) - c.JSON(http.StatusBadRequest, gin.H{"success": false}) - return - } - - logger.Infof("Parsed Create Source Credentials Payload: %v", sourceCred) - - err := databaseRepo.CreateSource(c, &sourceCred) - if err != nil { - logger.Errorln("An error occurred while storing source credential", err) - c.JSON(http.StatusInternalServerError, gin.H{"success": false}) - return - } - - // after creating the source, we should do a bulk import - err = syncSourceResources(c, logger, databaseRepo, sourceCred) - if err != nil { - c.JSON(http.StatusInternalServerError, gin.H{"success": false}) - return - } - - c.JSON(http.StatusOK, gin.H{"success": true, "data": sourceCred}) -} - func SourceSync(c *gin.Context) { logger := c.MustGet("LOGGER").(*logrus.Entry) databaseRepo := c.MustGet("REPOSITORY").(database.DatabaseRepository) diff --git a/backend/pkg/web/server.go b/backend/pkg/web/server.go index 5974adaa..03d906f9 100644 --- a/backend/pkg/web/server.go +++ b/backend/pkg/web/server.go @@ -47,7 +47,6 @@ func (ae *AppEngine) Setup(logger *logrus.Entry) *gin.Engine { { secure.GET("/summary", handler.GetSummary) - secure.POST("/source", handler.CreateSource) secure.POST("/source/manual", handler.CreateManualSource) secure.GET("/source", handler.ListSource) secure.GET("/source/:sourceId", handler.GetSource)