コード例 #1
0
        public async Task <IActionResult> Edit(LabelEditModel model)
        {
            if (model.IsNotValid())
            {
                model.SetInputModelValues();
                return(View(model));
            }

            var request  = new LabelEditRequest(CurrentUser.Id, model.OrganizationUid, model.LabelUid, model.Key, model.Description);
            var response = await _labelService.EditLabel(request);

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

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