コード例 #1
0
        public async Task <IActionResult> Deactivate(ShortcutIdRequestModel request)
        {
            if (!ModelState.IsValid)
            {
                return(RedirectToErrorPage());
            }

            var isInactived = await _shortcutService.DeactivateAsync(new ShortcutModifyRequest
            {
                Id          = request.Id,
                UpdatedById = LoggedUserId
            });

            if (!isInactived)
            {
                return(RedirectToErrorPage());
            }

            if (request.ShouldKeepUpdatePage)
            {
                return(RedirectToAction(nameof(Update), new { id = request.Id }));
            }

            return(RedirectToAction(nameof(Index)));
        }