Ejemplo n.º 1
0
        public async Task <IActionResult> ReplaceSuggestion([FromBody] ReplaceSuggestionViewModel replaceSuggestionViewModel)
        {
            var success = await _soStringService.ReplaceSuggestionAsync(
                replaceSuggestionViewModel.SuggestionId,
                replaceSuggestionViewModel.NewSuggestion,
                User.GetClaim <int>(ClaimType.Id));

            if (success)
            {
                return(NoContent());
            }

            return(BadRequest());
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> ReplaceSuggestion([FromBody] ReplaceSuggestionViewModel model)
        {
            var success = await _soStringsService.ReplaceSuggestionAsync(
                model.SuggestionId,
                model.NewSuggestion,
                User.GetClaim <int>(ClaimType.Id));

            if (!success)
            {
                return(BadRequest());
            }

            var stringId = await _soStringsService.GetStringIdBySuggestionId(model.SuggestionId);

            return(await GetStringSummaryViewModelFor(stringId));
        }