From 05090722a003dfa0bf46de217871e3bae3b08ae1 Mon Sep 17 00:00:00 2001 From: Fedorov Vladimir Date: Sat, 3 Oct 2026 13:10:39 +0700 Subject: [PATCH] fix --- internal/services/scenarios_service/service.go | 6 +++--- internal/services/scenarios_service/service_test.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/services/scenarios_service/service.go b/internal/services/scenarios_service/service.go index be224fd..680c861 100644 --- a/internal/services/scenarios_service/service.go +++ b/internal/services/scenarios_service/service.go @@ -609,14 +609,14 @@ func (s *ScenarioService) updateStory(ctx context.Context, id int, story *storyt // Общая для редактирования и импорта. func normalizeStory(story *storytelling.Story) (string, error) { if story.Conclusion != nil && story.Conclusion.Video != "" && file_storage.FileType(story.Conclusion.Video) != "video" { - return "", errors.New("Видео закрывашки должно быть в формате MP4 или WebM") + return "", errors.New("видео закрывашки должно быть в формате MP4 или WebM") } codes := map[string]struct{}{} for _, place := range story.Places { codes[place.Code] = struct{}{} } if len(codes) != len(story.Places) { - return "", errors.New("Такой код точки уже существует") + return "", errors.New("такой код точки уже существует") } cleanPlaces := make([]*storytelling.Place, 0, len(story.Places)) @@ -640,7 +640,7 @@ func normalizeStory(story *storytelling.Story) (string, error) { questionCodes[question.Code] = struct{}{} } if len(questionCodes) != len(story.Questions) { - return "", errors.New("Такой код вопроса уже существует") + return "", errors.New("такой код вопроса уже существует") } cleanQuestions := make([]*storytelling.Question, 0, len(story.Questions)) for _, question := range story.Questions { diff --git a/internal/services/scenarios_service/service_test.go b/internal/services/scenarios_service/service_test.go index c8e3935..7290ea7 100644 --- a/internal/services/scenarios_service/service_test.go +++ b/internal/services/scenarios_service/service_test.go @@ -883,7 +883,7 @@ func TestNormalizeStoryQuestionCodes(t *testing.T) { t.Fatalf("AddScenarioQuestion q1: %v", err) } err = svc.AddScenarioQuestion(context.Background(), 1, &storytelling.Question{Code: "q1"}, 7, false) - if err == nil || !strings.Contains(err.Error(), "Такой код вопроса уже существует") { + if err == nil || !strings.Contains(err.Error(), "такой код вопроса уже существует") { t.Errorf("AddScenarioQuestion с дублем кода: err = %v, want ошибку о дубле", err) }