fixed the route to pull sourceById
This commit is contained in:
parent
9237369e5a
commit
9ebfea122c
@ -95,10 +95,10 @@ func NewServer(ctx context.Context, configs services.Configs, conn *sql.DB) *Han
|
|||||||
//sources.POST("/new/youtube", s.newYoutubeSource)
|
//sources.POST("/new/youtube", s.newYoutubeSource)
|
||||||
//sources.POST("/new/twitch", s.newTwitchSource)
|
//sources.POST("/new/twitch", s.newTwitchSource)
|
||||||
sources.POST("/new/rss", s.newRssSource)
|
sources.POST("/new/rss", s.newRssSource)
|
||||||
sources.GET("/:ID/", s.getSource)
|
sources.GET("/:id", s.getSource)
|
||||||
sources.DELETE("/:ID/", s.deleteSources)
|
sources.DELETE("/:id", s.deleteSources)
|
||||||
sources.POST("/:ID/disable", s.disableSource)
|
sources.POST("/:id/disable", s.disableSource)
|
||||||
sources.POST("/:ID/enable", s.enableSource)
|
sources.POST("/:id/enable", s.enableSource)
|
||||||
|
|
||||||
users := v1.Group("/users")
|
users := v1.Group("/users")
|
||||||
users.POST("/login", s.AuthLogin)
|
users.POST("/login", s.AuthLogin)
|
||||||
|
@ -101,7 +101,7 @@ func (s *Handler) listSourcesBySource(c echo.Context) error {
|
|||||||
|
|
||||||
// GetSource
|
// GetSource
|
||||||
// @Summary Returns a single entity by ID
|
// @Summary Returns a single entity by ID
|
||||||
// @Param id path int true "uuid"
|
// @Param id path int true "id"
|
||||||
// @Produce application/json
|
// @Produce application/json
|
||||||
// @Tags Source
|
// @Tags Source
|
||||||
// @Router /v1/sources/{id} [get]
|
// @Router /v1/sources/{id} [get]
|
||||||
@ -122,7 +122,7 @@ func (s *Handler) getSource(c echo.Context) error {
|
|||||||
return c.JSON(http.StatusUnauthorized, p)
|
return c.JSON(http.StatusUnauthorized, p)
|
||||||
}
|
}
|
||||||
|
|
||||||
id, err := strconv.Atoi(c.Param("ID"))
|
id, err := strconv.Atoi(c.Param("id"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
p.BaseResponse.Message = err.Error()
|
p.BaseResponse.Message = err.Error()
|
||||||
return c.JSON(http.StatusBadRequest, p)
|
return c.JSON(http.StatusBadRequest, p)
|
||||||
|
Loading…
Reference in New Issue
Block a user