Ejemplo n.º 1
0
        public async Task <IActionResult> Create(IntegrationCreateModel model)
        {
            if (model.IsNotValid())
            {
                model.SetInputModelValues();
                return(View(model));
            }

            var request  = new IntegrationCreateRequest(CurrentUser.Id, model.OrganizationUid, model.Name, model.Description);
            var response = await _integrationService.CreateIntegration(request);

            if (response.Status.IsNotSuccess)
            {
                model.MapMessages(response);
                model.SetInputModelValues();
                return(View(model));
            }

            CurrentUser.IsActionSucceed = true;
            return(Redirect($"/Integration/Detail/{response.Item.Uid}"));
        }