commit
215a160205
|
@ -2,6 +2,7 @@ package joke
|
|||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
"jokes-bapak2-api/core/schema"
|
||||
|
||||
"github.com/Masterminds/squirrel"
|
||||
|
@ -47,7 +48,7 @@ func SetTotalJoke(db *pgxpool.Pool, ctx context.Context, memory *bigcache.BigCac
|
|||
return err
|
||||
}
|
||||
|
||||
var total = []byte{byte(len(data))}
|
||||
var total = []byte(strconv.Itoa(len(data)))
|
||||
err = memory.Set("total", total)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
@ -3,7 +3,6 @@ package joke
|
|||
import (
|
||||
"errors"
|
||||
core "jokes-bapak2-api/core/joke"
|
||||
"strconv"
|
||||
|
||||
"github.com/allegro/bigcache/v3"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
|
@ -38,6 +37,6 @@ func (d *Dependencies) TotalJokes(c *fiber.Ctx) error {
|
|||
return c.
|
||||
Status(fiber.StatusOK).
|
||||
JSON(ResponseJoke{
|
||||
Message: strconv.Itoa(int(total[0])),
|
||||
Message: string(total),
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue