TP-55555|db additions adjustments in service,handler
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"cybertron/models/db"
|
||||
"cybertron/service"
|
||||
"net/http"
|
||||
|
||||
@@ -24,16 +23,5 @@ func (h *SourceMapHandler) GetSourceMap(c *gin.Context) {
|
||||
}
|
||||
|
||||
func (h *SourceMapHandler) StoreSourceMap(c *gin.Context) {
|
||||
var sourceMap db.SourceMap
|
||||
if err := c.ShouldBindJSON(&sourceMap); err != nil {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
|
||||
if err := h.sourceMapService.StoreSourceMap(sourceMap); err != nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "Failed to store source map"})
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{"status": "Source map stored successfully"})
|
||||
h.sourceMapService.StoreSourceMap(c)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user