generated from VLADIMIR/template
add games
This commit is contained in:
@@ -20,7 +20,6 @@ func NewGenerator(length int) IPasswordGenerator {
|
||||
}
|
||||
|
||||
func (g *generator) Generate() (string, error) {
|
||||
return "1", nil
|
||||
password := make([]byte, g.length)
|
||||
for i := range password {
|
||||
num, err := rand.Int(rand.Reader, big.NewInt(int64(len(charset))))
|
||||
|
||||
@@ -174,6 +174,15 @@ func (s *ScenarioService) updateStory(ctx context.Context, id int, story *storyt
|
||||
return errors.New("Такой код точки уже существует")
|
||||
}
|
||||
|
||||
cleanPlaces := make([]*storytelling.Place, 0, len(story.Places))
|
||||
for _, place := range story.Places {
|
||||
if place.Code == "" {
|
||||
continue
|
||||
}
|
||||
cleanPlaces = append(cleanPlaces, place)
|
||||
}
|
||||
story.Places = cleanPlaces
|
||||
|
||||
storyString, err := convertStory(story)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user