diff --git a/bin/evening_detective_server b/bin/evening_detective_server index 4d324fa..1c9bddf 100755 Binary files a/bin/evening_detective_server and b/bin/evening_detective_server differ diff --git a/cmd/evening_detective_server/main.go b/cmd/evening_detective_server/main.go index 79676ed..14acb7e 100644 --- a/cmd/evening_detective_server/main.go +++ b/cmd/evening_detective_server/main.go @@ -100,6 +100,7 @@ func main() { storyteller, actionsRepo, applicationsRepo, + cleaner, ) // Create a listener on TCP port diff --git a/internal/services/game_service/service.go b/internal/services/game_service/service.go index 63894b4..9b56d10 100644 --- a/internal/services/game_service/service.go +++ b/internal/services/game_service/service.go @@ -2,6 +2,7 @@ package game_service import ( "context" + "evening_detective_server/internal/modules/cleaner" "evening_detective_server/internal/modules/password_generator" "evening_detective_server/internal/modules/storytelling" "evening_detective_server/internal/repos/actions_repo" @@ -23,6 +24,7 @@ type GameService struct { storyteller storytelling.IStory actionsRepo *actions_repo.ActionsRepo applicationsRepo *applications_repo.ApplicationsRepo + cleaner cleaner.ICleaner } func NewGameService( @@ -35,6 +37,7 @@ func NewGameService( storyteller storytelling.IStory, actionsRepo *actions_repo.ActionsRepo, applicationsRepo *applications_repo.ApplicationsRepo, + cleaner cleaner.ICleaner, ) *GameService { return &GameService{ gamesRepo: gamesRepo, @@ -46,6 +49,7 @@ func NewGameService( storyteller: storyteller, actionsRepo: actionsRepo, applicationsRepo: applicationsRepo, + cleaner: cleaner, } } @@ -224,7 +228,7 @@ func (s *GameService) AddTeamAction(ctx context.Context, teamId int, password st lastPlace := teamStory.Places[len(teamStory.Places)-1] for _, application := range lastPlace.Applications { - _, err := s.applicationsRepo.AddApplication(ctx, teamId, application.Name, application.Image) + _, err := s.applicationsRepo.AddApplication(ctx, teamId, s.cleaner.ClearText(application.Name), application.Image) if err != nil { return err }