fix: total would always return error before

This commit is contained in:
Reinaldy Rafli 2021-07-20 01:35:04 +07:00
parent 4f13a85cea
commit dc2eab709e
1 changed files with 1 additions and 2 deletions

View File

@ -3,7 +3,6 @@ package handler
import (
"jokes-bapak2-api/app/v1/core"
"jokes-bapak2-api/app/v1/models"
"log"
"strconv"
"github.com/gofiber/fiber/v2"
@ -23,7 +22,7 @@ func TotalJokes(c *fiber.Ctx) error {
}
total, err := memory.Get("total")
log.Println(err)
if err != nil {
if err.Error() == "Entry not found" {
return c.Status(fiber.StatusInternalServerError).JSON(models.Error{