Skip to content

Commit 1493b83

Browse files
committed
v1 api routes should return an error
1 parent 21133d9 commit 1493b83

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

api/routes/routes.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package routes
22

33
import (
4+
"errors"
5+
46
"github.com/MicroFish91/portfolio-instruments-api/api/types"
57
"github.com/MicroFish91/portfolio-instruments-api/api/utils"
68
"github.com/gofiber/fiber/v3"
@@ -21,7 +23,7 @@ func RegisterRoutes(
2123
})
2224

2325
app.All("/api/v1*", func(c fiber.Ctx) error {
24-
return utils.SendJSON(c, fiber.StatusGone, fiber.Map{"message": "The v1 API has been officially deprecated, please use the v2 API"})
26+
return utils.SendError(c, fiber.StatusGone, errors.New("The v1 API has been officially deprecated, please upgrade to the v2 API"))
2527
})
2628

2729
routerV2 := app.Group("/api/v2")

0 commit comments

Comments
 (0)