From db9b0bbb1d5326790f30d7d8595ece8144123914 Mon Sep 17 00:00:00 2001 From: James Tombleson Date: Sat, 4 May 2024 11:47:02 -0700 Subject: [PATCH] Removed the settings handler because its not needed anymore --- internal/handler/v1/settings.go | 39 --------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 internal/handler/v1/settings.go diff --git a/internal/handler/v1/settings.go b/internal/handler/v1/settings.go deleted file mode 100644 index 26367af..0000000 --- a/internal/handler/v1/settings.go +++ /dev/null @@ -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) -}