Removed the settings handler because its not needed anymore

This commit is contained in:
James Tombleson 2024-05-04 11:47:02 -07:00
parent e57b115117
commit db9b0bbb1d

View File

@ -1,39 +0,0 @@
package v1
import (
"encoding/json"
"net/http"
"git.jamestombleson.com/jtom38/newsbot-api/internal/domain"
"github.com/google/uuid"
"github.com/labstack/echo/v4"
)
// GetSettings
// @Summary Returns a object based on the Key that was given.
// @Param key path string true "Settings Key value"
// @Produce application/json
// @Tags Settings
// @Router /v1/settings/{key} [get]
func (s *Handler) getSettings(c echo.Context) error {
id := c.Param("ID")
uuid, err := uuid.Parse(id)
if err != nil {
return c.JSON(http.StatusBadRequest, domain.BaseResponse{
Message: err.Error(),
})
}
res, err := s.Db.GetSourceByID(c.Request().Context(), uuid)
if err != nil {
return c.JSON(http.StatusInternalServerError, err.Error())
}
bResult, err := json.Marshal(res)
if err != nil {
return c.JSON(http.StatusInternalServerError, err.Error())
}
return c.JSON(http.StatusOK, bResult)
}