🐛 Provide the correct status code when subscription not found
This commit is contained in:
parent
16391ce18f
commit
9a59df6b5e
@ -23,7 +23,7 @@ func getSubscriptionOnUser(c *fiber.Ctx) error {
|
||||
|
||||
subscription, err := services.GetSubscriptionOnUser(user, otherUser)
|
||||
if err != nil {
|
||||
return fiber.NewError(fiber.StatusBadRequest, fmt.Sprintf("unable to get subscription: %v", err))
|
||||
return fiber.NewError(fiber.StatusNotFound, fmt.Sprintf("unable to get subscription: %v", err))
|
||||
}
|
||||
|
||||
return c.JSON(subscription)
|
||||
@ -43,7 +43,7 @@ func getSubscriptionOnTag(c *fiber.Ctx) error {
|
||||
|
||||
subscription, err := services.GetSubscriptionOnTag(user, tag)
|
||||
if err != nil {
|
||||
return fiber.NewError(fiber.StatusBadRequest, fmt.Sprintf("unable to get subscription: %v", err))
|
||||
return fiber.NewError(fiber.StatusNotFound, fmt.Sprintf("unable to get subscription: %v", err))
|
||||
}
|
||||
|
||||
return c.JSON(subscription)
|
||||
@ -63,7 +63,7 @@ func getSubscriptionOnCategory(c *fiber.Ctx) error {
|
||||
|
||||
subscription, err := services.GetSubscriptionOnCategory(user, category)
|
||||
if err != nil {
|
||||
return fiber.NewError(fiber.StatusBadRequest, fmt.Sprintf("unable to get subscription: %v", err))
|
||||
return fiber.NewError(fiber.StatusNotFound, fmt.Sprintf("unable to get subscription: %v", err))
|
||||
}
|
||||
|
||||
return c.JSON(subscription)
|
||||
|
Loading…
Reference in New Issue
Block a user