Пример #1
0
        public async Task <IActionResult> CanActivateModel([FromQuery] string model_component_guid, [FromQuery] bool activate)
        {
            CanActivateModelData result = await _modelsService.CanActivateModel(model_component_guid);

            if (activate)
            {
                if (result.incorrect_weight_list.Count == 0 && result.not_active_list.Count == 0 && result.not_in_form_list.Count == 0)
                {
                    await _modelsService.ChangeModelComponentStatus(model_component_guid, ModelComponentStatus.active);
                }
            }

            return(await _modelsService.OkResult(result));
        }