improvements on http return codes

main
Nilo Roberto C Paim 2025-09-03 10:30:18 -03:00
parent b3be5b8bbf
commit 826a9884a5
1 changed files with 4 additions and 4 deletions

View File

@ -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)
}