Skip to content

Commit b128e16

Browse files
thomaspoignantThomas POIGNANT
and
Thomas POIGNANT
authored
Rename function (#5)
Co-authored-by: Thomas POIGNANT <thomas.poignant@MacBook-Pro-de-Thomas.local>
1 parent 952b4dd commit b128e16

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

api/server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func (s *Server) Start() {
4141
// init API routes
4242
groupV1 := s.apiEcho.Group("/v1")
4343
groupV1.GET("/flags", s.flagHandlers.GetAllFeatureFlags)
44-
groupV1.GET("/flags/:id", s.flagHandlers.GetFeatureFlagsByID)
44+
groupV1.GET("/flags/:id", s.flagHandlers.GetFeatureFlagByID)
4545
groupV1.POST("/flags", s.flagHandlers.CreateNewFlag)
4646
groupV1.PUT("/flags/:id", s.flagHandlers.UpdateFlagByID)
4747
groupV1.DELETE("/flags/:id", s.flagHandlers.DeleteFlagByID)

handler/flags.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import (
44
"database/sql"
55
"errors"
66
"fmt"
7+
"github.com/labstack/echo/v4"
78
"net/http"
89
"time"
910

1011
"github.com/go-feature-flag/app-api/dao"
1112
"github.com/go-feature-flag/app-api/model"
1213
"github.com/google/uuid"
13-
"github.com/labstack/echo/v4"
1414
"github.com/lib/pq"
1515
)
1616

@@ -39,7 +39,7 @@ func (f Flags) GetAllFeatureFlags(c echo.Context) error {
3939
return c.JSON(http.StatusOK, flags)
4040
}
4141

42-
// GetFeatureFlagsByID is returning the flag belonging to the given ID
42+
// GetFeatureFlagByID is returning the flag belonging to the given ID
4343
// @Summary Return all the information about a flag
4444
// @Tags Feature Flag management API
4545
// @Description GET all the information about a flag with a specific .
@@ -48,7 +48,7 @@ func (f Flags) GetAllFeatureFlags(c echo.Context) error {
4848
// @Failure 404 {object} model.HTTPError "Not Found"
4949
// @Failure 500 {object} model.HTTPError "Internal server error"
5050
// @Router /v1/flags/{id} [get]
51-
func (f Flags) GetFeatureFlagsByID(c echo.Context) error {
51+
func (f Flags) GetFeatureFlagByID(c echo.Context) error {
5252
flag, err := f.dao.GetFlagByID(c.Request().Context(), c.Param("id"))
5353
if err != nil {
5454
if errors.Is(err, sql.ErrNoRows) {

0 commit comments

Comments
 (0)