generated from VLADIMIR/template
fix images
This commit is contained in:
Binary file not shown.
@@ -4,6 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"evening_detective_server/internal/modules/storytelling"
|
||||
"evening_detective_server/internal/repos"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func mapScenarios(
|
||||
@@ -57,7 +58,10 @@ func mapStory(o string, domain string) (*storytelling.Story, error) {
|
||||
return res, nil
|
||||
}
|
||||
|
||||
func convertStory(o *storytelling.Story) (string, error) {
|
||||
func convertStory(o *storytelling.Story, domain string) (string, error) {
|
||||
for _, place := range o.Places {
|
||||
place.Image = strings.TrimLeft(place.Image, domain)
|
||||
}
|
||||
b, err := json.Marshal(o)
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
||||
@@ -143,7 +143,7 @@ func (s *ScenarioService) updateStory(ctx context.Context, id int, story *storyt
|
||||
return errors.New("Такой код точки уже существует")
|
||||
}
|
||||
|
||||
storyString, err := convertStory(story)
|
||||
storyString, err := convertStory(story, s.domain)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user