update question
This commit is contained in:
parent
9555497d4e
commit
7cbff22d8a
3 changed files with 45 additions and 0 deletions
|
|
@ -56,6 +56,17 @@ public class QuestionController : ControllerBase
|
|||
return Ok(result);
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
[HttpPut("{id}")]
|
||||
public async Task<IActionResult> UpdateQuestion([FromBody] QuestionUpdateDto dto, [FromRoute] int id,
|
||||
[FromRoute] int surveyId)
|
||||
{
|
||||
var question = QuestionMapper.QuestionUpdateToModel(dto, surveyId, id);
|
||||
await _questionService.UpdateQuestionAsync(question);
|
||||
var result = QuestionMapper.ModelToQuestionDto(question);
|
||||
return Ok(result);
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
[HttpDelete("{id}")]
|
||||
public async Task<IActionResult> DeleteQuestion([FromRoute] int id, [FromRoute] int surveyId)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue