return created objects
This commit is contained in:
parent
251810c973
commit
98b38f645f
2 changed files with 6 additions and 4 deletions
|
|
@ -65,14 +65,15 @@ public class SurveyController : ControllerBase
|
|||
/// <returns></returns>
|
||||
[Authorize]
|
||||
[HttpPost]
|
||||
[ProducesResponseType(StatusCodes.Status201Created)]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
public async Task<IActionResult> Post([FromBody] CreateSurveyDto dto)
|
||||
{
|
||||
var userId = _userContext.UserId;
|
||||
|
||||
var survey = SurveyMapper.CreateDtoToModel(dto, userId);
|
||||
await _surveyService.AddSurveyAsync(survey);
|
||||
return Created();
|
||||
var result = SurveyMapper.ModelToOutputDto(survey);
|
||||
return Ok(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue