Skip to content

Commit 7b243f4

Browse files
committed
refactor: enable embed
1 parent 81730c1 commit 7b243f4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/routes/embed.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
package routes
22

33
import (
4+
"encoding/json"
45
"fmt"
6+
"skycrypt/src/constants"
7+
redis "skycrypt/src/db"
8+
"skycrypt/src/models"
59
"time"
610

711
"github.com/gofiber/fiber/v2"
@@ -12,7 +16,7 @@ func EmbedHandler(c *fiber.Ctx) error {
1216

1317
uuid := c.Params("uuid")
1418
profileId := c.Params("profileId")
15-
/*embed, err := redis.Get(fmt.Sprintf("embed:%s:%s", uuid, profileId))
19+
embed, err := redis.Get(fmt.Sprintf("embed:%s:%s", uuid, profileId))
1620
if err != nil {
1721
c.Status(400)
1822
return c.JSON(constants.InvalidUserError)
@@ -22,12 +26,11 @@ func EmbedHandler(c *fiber.Ctx) error {
2226
if err := json.Unmarshal([]byte(embed), &embedData); err != nil {
2327
c.Status(500)
2428
return c.JSON(constants.InternalServerError)
25-
}*/
29+
}
2630

2731
fmt.Printf("Returning /api/embed/%s in %s\n", profileId, time.Since(timeNow))
2832

29-
3033
return c.JSON(fiber.Map{
31-
"embed": uuid,
34+
"embed": embedData,
3235
})
3336
}

0 commit comments

Comments
 (0)