diff --git a/pkg/server/channels_api.go b/pkg/server/channels_api.go index 9d14eb3..3f8e437 100644 --- a/pkg/server/channels_api.go +++ b/pkg/server/channels_api.go @@ -37,7 +37,7 @@ func getChannelAvailability(c *fiber.Ctx) error { channel, _, err = services.GetAvailableChannelWithAlias(alias, user) } if err != nil { - return fiber.NewError(fiber.StatusForbidden, err.Error()) + return c.Status(fiber.StatusForbidden).JSON(channel) } return c.JSON(channel) diff --git a/pkg/server/startup.go b/pkg/server/startup.go index c56be90..8562d19 100644 --- a/pkg/server/startup.go +++ b/pkg/server/startup.go @@ -79,7 +79,7 @@ func NewServer() { { channels.Get("/", listChannel) channels.Get("/:channel", getChannel) - channels.Get("/:channel/available", authMiddleware, getChannelAvailability) + channels.Get("/:channel/availability", authMiddleware, getChannelAvailability) channels.Get("/me", authMiddleware, listOwnedChannel) channels.Get("/me/available", authMiddleware, listAvailableChannel)