fix: nullable server id in activity log and fix preset logging

This commit is contained in:
2026-03-26 22:48:59 +01:00
parent f23f276ee5
commit f2580b6de0
6 changed files with 31 additions and 14 deletions

View File

@@ -110,7 +110,7 @@ func (as *ServiceControlService) ServiceControlStartServer(ctx *fiber.Ctx) (stri
actorID, actorUsername := extractActor(ctx)
go func() {
_ = as.activityLog.Log(context.Background(), &model.ActivityLog{
ServerID: server.ID,
ServerID: &server.ID,
UserID: actorID,
Username: actorUsername,
Action: model.ActionServerStart,
@@ -147,7 +147,7 @@ func (as *ServiceControlService) ServiceControlStopServer(ctx *fiber.Ctx) (strin
actorID, actorUsername := extractActor(ctx)
go func() {
_ = as.activityLog.Log(context.Background(), &model.ActivityLog{
ServerID: server.ID,
ServerID: &server.ID,
UserID: actorID,
Username: actorUsername,
Action: model.ActionServerStop,
@@ -184,7 +184,7 @@ func (as *ServiceControlService) ServiceControlRestartServer(ctx *fiber.Ctx) (st
actorID, actorUsername := extractActor(ctx)
go func() {
_ = as.activityLog.Log(context.Background(), &model.ActivityLog{
ServerID: server.ID,
ServerID: &server.ID,
UserID: actorID,
Username: actorUsername,
Action: model.ActionServerRestart,