generated from VLADIMIR/template
fix
This commit is contained in:
@@ -27,9 +27,7 @@ func (s *server) AddScenarioPlace(ctx context.Context, req *proto.AddScenarioPla
|
||||
roles.HasRole(claims, roles.Admin),
|
||||
)
|
||||
if err != nil {
|
||||
return &proto.AddScenarioPlaceRsp{
|
||||
Error: err.Error(),
|
||||
}, nil
|
||||
return nil, scenarioErrorStatus(err, "не удалось добавить место сценария")
|
||||
}
|
||||
|
||||
return &proto.AddScenarioPlaceRsp{}, nil
|
||||
@@ -53,9 +51,7 @@ func (s *server) UpdateScenarioPlace(ctx context.Context, req *proto.UpdateScena
|
||||
roles.HasRole(claims, roles.Admin),
|
||||
)
|
||||
if err != nil {
|
||||
return &proto.UpdateScenarioPlaceRsp{
|
||||
Error: err.Error(),
|
||||
}, nil
|
||||
return nil, scenarioErrorStatus(err, "не удалось изменить место сценария")
|
||||
}
|
||||
|
||||
return &proto.UpdateScenarioPlaceRsp{}, nil
|
||||
@@ -78,9 +74,7 @@ func (s *server) DeleteScenarioPlace(ctx context.Context, req *proto.DeleteScena
|
||||
roles.HasRole(claims, roles.Admin),
|
||||
)
|
||||
if err != nil {
|
||||
return &proto.DeleteScenarioPlaceRsp{
|
||||
Error: err.Error(),
|
||||
}, nil
|
||||
return nil, scenarioErrorStatus(err, "не удалось удалить место сценария")
|
||||
}
|
||||
|
||||
return &proto.DeleteScenarioPlaceRsp{}, nil
|
||||
@@ -103,9 +97,7 @@ func (s *server) AddScenarioQuestion(ctx context.Context, req *proto.AddScenario
|
||||
roles.HasRole(claims, roles.Admin),
|
||||
)
|
||||
if err != nil {
|
||||
return &proto.AddScenarioQuestionRsp{
|
||||
Error: err.Error(),
|
||||
}, nil
|
||||
return nil, scenarioErrorStatus(err, "не удалось добавить вопрос сценария")
|
||||
}
|
||||
|
||||
return &proto.AddScenarioQuestionRsp{}, nil
|
||||
@@ -129,9 +121,7 @@ func (s *server) UpdateScenarioQuestion(ctx context.Context, req *proto.UpdateSc
|
||||
roles.HasRole(claims, roles.Admin),
|
||||
)
|
||||
if err != nil {
|
||||
return &proto.UpdateScenarioQuestionRsp{
|
||||
Error: err.Error(),
|
||||
}, nil
|
||||
return nil, scenarioErrorStatus(err, "не удалось изменить вопрос сценария")
|
||||
}
|
||||
|
||||
return &proto.UpdateScenarioQuestionRsp{}, nil
|
||||
@@ -154,9 +144,7 @@ func (s *server) DeleteScenarioQuestion(ctx context.Context, req *proto.DeleteSc
|
||||
roles.HasRole(claims, roles.Admin),
|
||||
)
|
||||
if err != nil {
|
||||
return &proto.DeleteScenarioQuestionRsp{
|
||||
Error: err.Error(),
|
||||
}, nil
|
||||
return nil, scenarioErrorStatus(err, "не удалось удалить вопрос сценария")
|
||||
}
|
||||
|
||||
return &proto.DeleteScenarioQuestionRsp{}, nil
|
||||
@@ -179,9 +167,7 @@ func (s *server) UpdateScenarioBackground(ctx context.Context, req *proto.Update
|
||||
roles.HasRole(claims, roles.Admin),
|
||||
)
|
||||
if err != nil {
|
||||
return &proto.UpdateScenarioBackgroundRsp{
|
||||
Error: err.Error(),
|
||||
}, nil
|
||||
return nil, scenarioErrorStatus(err, "не удалось изменить фон сценария")
|
||||
}
|
||||
|
||||
return &proto.UpdateScenarioBackgroundRsp{}, nil
|
||||
@@ -204,9 +190,7 @@ func (s *server) UpdateScenarioIntro(ctx context.Context, req *proto.UpdateScena
|
||||
roles.HasRole(claims, roles.Admin),
|
||||
)
|
||||
if err != nil {
|
||||
return &proto.UpdateScenarioIntroRsp{
|
||||
Error: err.Error(),
|
||||
}, nil
|
||||
return nil, scenarioErrorStatus(err, "не удалось изменить введение сценария")
|
||||
}
|
||||
|
||||
return &proto.UpdateScenarioIntroRsp{}, nil
|
||||
@@ -221,7 +205,7 @@ func (s *server) UpdateScenarioConclusion(ctx context.Context, req *proto.Update
|
||||
return nil, status.Errorf(codes.PermissionDenied, "permission denied")
|
||||
}
|
||||
if err := s.scenarioService.UpdateScenarioConclusion(ctx, int(req.ID), convertConclusion(req.Conclusion), claims.UserID, roles.HasRole(claims, roles.Admin)); err != nil {
|
||||
return &proto.UpdateScenarioConclusionRsp{Error: err.Error()}, nil
|
||||
return nil, scenarioErrorStatus(err, "не удалось изменить заключение сценария")
|
||||
}
|
||||
return &proto.UpdateScenarioConclusionRsp{}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user