Exemplo n.º 1
0
        public async Task <IActionResult> Review([FromBody] ReviewViewModel model)
        {
            if (!model.SuggestionId.HasValue || !model.Approve.HasValue)
            {
                return(BadRequest());
            }

            var success = await _soStringService.ReviewSuggestionAsync(
                model.SuggestionId.Value,
                model.Approve.Value,
                User.GetClaim <int>(ClaimType.Id),
                User.GetClaim <UserType>(ClaimType.UserType));

            if (success)
            {
                return(new EmptyResult());
            }

            return(BadRequest());
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Review([FromBody] ReviewViewModel model)
        {
            if (!model.SuggestionId.HasValue || !model.Approve.HasValue)
            {
                return(BadRequest());
            }

            var success = await _soStringsService.ReviewSuggestionAsync(
                model.SuggestionId.Value,
                model.Approve.Value,
                User.GetClaim <int>(ClaimType.Id),
                User.GetClaim <UserType>(ClaimType.UserType),
                Request.Host.ToString());

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

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

            return(await GetStringSummaryViewModelFor(stringId));
        }