Ejemplo n.º 1
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));
        }