improvements on http return codes
parent
b3be5b8bbf
commit
826a9884a5
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue