From 826a9884a51a4f5dc99295a1a43424c841aa9bb9 Mon Sep 17 00:00:00 2001 From: Nilo Date: Wed, 3 Sep 2025 10:30:18 -0300 Subject: [PATCH] improvements on http return codes --- controllers/transmissionController.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/controllers/transmissionController.go b/controllers/transmissionController.go index 16400af..f0536fa 100644 --- a/controllers/transmissionController.go +++ b/controllers/transmissionController.go @@ -21,7 +21,7 @@ func GetTransmissionByChannel(c *fiber.Ctx) error { transmission, exists := globals.Transmissions[channel] if !exists { - return fiber.ErrNotFound + return c.SendStatus(fiber.StatusNotFound) } return c.JSON(transmission) @@ -39,7 +39,7 @@ func WatchersCount(c *fiber.Ctx) error { return c.JSON(transmission.Watchers) } - return fiber.ErrNotFound + return c.SendStatus(fiber.StatusNotFound) } // Called when a user starts to watch a transmission @@ -65,7 +65,7 @@ func Watch(c *fiber.Ctx) error { return c.JSON(transmission.Watchers) } - return fiber.ErrNotFound + return c.SendStatus(fiber.StatusNotFound) } // Called when a user stops watching a transmission @@ -94,5 +94,5 @@ func Leave(c *fiber.Ctx) error { return c.JSON(transmission.Watchers) } - return fiber.ErrNotFound + return c.SendStatus(fiber.StatusNotFound) }