generated from VLADIMIR/template
fix applications
This commit is contained in:
Binary file not shown.
@@ -100,6 +100,7 @@ func main() {
|
||||
storyteller,
|
||||
actionsRepo,
|
||||
applicationsRepo,
|
||||
cleaner,
|
||||
)
|
||||
|
||||
// Create a listener on TCP port
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user