in api.go [162:180]
func (h apiHandlers) getProductTypeDetails(c *gin.Context) {
id, err := strconv.Atoi(c.Param("id"))
if err != nil {
err := errors.Wrap(err, "failed to parse product type ID")
c.AbortWithError(http.StatusInternalServerError, err)
return
}
productType, err := getProductType(c.Request.Context(), h.db, id)
if err != nil {
err := errors.Wrap(err, "failed to get product type details")
c.AbortWithError(http.StatusInternalServerError, err)
return
}
if productType == nil {
c.AbortWithStatus(http.StatusNotFound)
return
}
c.JSON(http.StatusOK, productType)
}