File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 11package routes
22
33import (
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}
You can’t perform that action at this time.
0 commit comments