This commit is contained in:
2026-07-24 01:14:28 +07:00
parent c79cff2709
commit 37372cdd86
3 changed files with 4 additions and 6 deletions
@@ -5,6 +5,7 @@ import (
"errors"
"evening_detective_server/internal/modules/storytelling"
"evening_detective_server/internal/repos/scenarios_repo"
"strings"
)
type ScenarioService struct {
@@ -138,12 +139,13 @@ func (s *ScenarioService) updateStory(ctx context.Context, id int, story *storyt
mapCodes := map[string]struct{}{}
for _, place := range story.Places {
mapCodes[place.Code] = struct{}{}
place.Image = strings.TrimPrefix(place.Image, s.domain)
}
if len(mapCodes) != len(story.Places) {
return errors.New("Такой код точки уже существует")
}
storyString, err := convertStory(story, s.domain)
storyString, err := convertStory(story)
if err != nil {
return err
}