feat: decode uid
This commit is contained in:
@@ -37,12 +37,7 @@ func (h *AnalyticsHandler) TrackEvent(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
userID, err := common.GetUserIDFromContext(c)
|
userID := common.GetUserIDFromContext(c)
|
||||||
if err != nil {
|
|
||||||
log.Error(c.Request.Context(), "get user id failed", "error", err)
|
|
||||||
c.JSON(http.StatusOK, common.ErrorResponse(c, common.CodeUnauthorized, "unauthorized"))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
req.UserID = userID
|
req.UserID = userID
|
||||||
|
|
||||||
if err := h.analyticsService.TrackEvent(c.Request.Context(), &req); err != nil {
|
if err := h.analyticsService.TrackEvent(c.Request.Context(), &req); err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user