feat: add activity logs

This commit is contained in:
2026-03-22 13:52:15 +01:00
parent 85c5874bc7
commit e96b8bca12
17 changed files with 517 additions and 26 deletions

View File

@@ -11,6 +11,7 @@ import (
"github.com/google/uuid"
)
type LeaderboardController struct {
service *service.LeaderboardService
errorHandler *error_handler.ControllerErrorHandler
@@ -60,7 +61,14 @@ func (lc *LeaderboardController) Update(c *fiber.Ctx) error {
return lc.errorHandler.HandleParsingError(c, err)
}
data, err := lc.service.Update(c.UserContext(), serverID, &input)
userInfo, _ := c.Locals("userInfo").(*middleware.CachedUserInfo)
actorID, actorUsername := "", "system"
if userInfo != nil {
actorID = userInfo.UserID
actorUsername = userInfo.Username
}
data, err := lc.service.Update(c.UserContext(), serverID, &input, actorID, actorUsername)
if err != nil {
return lc.errorHandler.HandleServiceError(c, err)
}