Update SurveyLib and start refactoring endpoint paths
This commit is contained in:
parent
c2f6ba6dde
commit
637e6c9824
5 changed files with 22 additions and 15 deletions
|
|
@ -64,11 +64,11 @@ public class QuestionController : ControllerBase
|
|||
/// <param name="surveyId"></param>
|
||||
/// <returns></returns>
|
||||
[Authorize]
|
||||
[HttpPut("{id}")]
|
||||
public async Task<IActionResult> UpdateQuestion([FromBody] QuestionUpdateDto dto, [FromRoute] int id,
|
||||
[FromRoute] int surveyId)
|
||||
[HttpPut]
|
||||
[Route("/api/questions/{id:int}")]
|
||||
public async Task<IActionResult> UpdateQuestion([FromBody] QuestionUpdateDto dto, [FromRoute] int id)
|
||||
{
|
||||
var question = QuestionMapper.QuestionUpdateToModel(dto, surveyId, id);
|
||||
var question = QuestionMapper.QuestionUpdateToModel(dto, id);
|
||||
await _questionService.UpdateQuestionAsync(question);
|
||||
var result = QuestionMapper.ModelToQuestionDto(question);
|
||||
return Ok(result);
|
||||
|
|
@ -81,8 +81,9 @@ public class QuestionController : ControllerBase
|
|||
/// <param name="surveyId"></param>
|
||||
/// <returns></returns>
|
||||
[Authorize]
|
||||
[HttpDelete("{id}")]
|
||||
public async Task<IActionResult> DeleteQuestion([FromRoute] int id, [FromRoute] int surveyId)
|
||||
[HttpDelete]
|
||||
[Route("/api/questions/{id:int}")]
|
||||
public async Task<IActionResult> DeleteQuestion([FromRoute] int id)
|
||||
{
|
||||
await _questionService.DeleteQuestionAsync(id);
|
||||
return Ok();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue