Merge pull request #13 from WahidinAji/master

I'm joking btw :D
This commit is contained in:
Reinaldy Rafli 2022-05-14 07:07:46 +07:00 committed by GitHub
commit 215a160205
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

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

View File

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