Skip to content

Commit

Permalink
standardize generations api response
Browse files Browse the repository at this point in the history
  • Loading branch information
isaaguilar committed May 2, 2024
1 parent 295d08e commit ff2bc69
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/api/get_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ func (h APIHandler) GetDistinctGeneration(c *gin.Context) {
uuid := c.Param("tfo_resource_uuid")
var generation []int
if result := h.DB.Raw("SELECT DISTINCT generation FROM tfo_resource_specs WHERE tfo_resource_uuid = ?", &uuid).Scan(&generation); result.Error != nil {
c.AbortWithError(http.StatusNotFound, result.Error)
c.JSON(http.StatusNotFound, response(http.StatusNotFound, result.Error.Error(), nil))
return
}
c.JSON(http.StatusOK, &generation)
c.JSON(http.StatusOK, response(http.StatusOK, "", generation))
}

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

0 comments on commit ff2bc69

Please sign in to comment.