generated from VLADIMIR/template
fix
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user