Skip to content

Commit 402a109

Browse files
committed
standardize generations api response
1 parent ea12d3b commit 402a109

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/api/get_record.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ func (h APIHandler) GetDistinctGeneration(c *gin.Context) {
6262
uuid := c.Param("tfo_resource_uuid")
6363
var generation []int
6464
if result := h.DB.Raw("SELECT DISTINCT generation FROM tfo_resource_specs WHERE tfo_resource_uuid = ?", &uuid).Scan(&generation); result.Error != nil {
65-
c.AbortWithError(http.StatusNotFound, result.Error)
65+
c.JSON(http.StatusNotFound, response(http.StatusNotFound, result.Error.Error(), nil))
6666
return
6767
}
68-
c.JSON(http.StatusOK, &generation)
68+
c.JSON(http.StatusOK, response(http.StatusOK, "", generation))
6969
}
7070

7171
func (h APIHandler) GetUuidByClusterID(c *gin.Context) {

0 commit comments

Comments
 (0)