add completions methods (not final)
This commit is contained in:
parent
58b5b2b17d
commit
c2f6ba6dde
4 changed files with 23 additions and 5 deletions
|
|
@ -26,14 +26,18 @@ public class CompletionController : ControllerBase
|
|||
[Authorize]
|
||||
public async Task<IActionResult> GetCompletionsAsync(int surveyId)
|
||||
{
|
||||
return NotFound();
|
||||
var models = await _completionService.GetCompletionsBySurveyIdAsync(surveyId);
|
||||
var result = models.Select(CompletionMapper.ModelToOutputDto);
|
||||
return Ok(result);
|
||||
}
|
||||
|
||||
[HttpGet("{id:int}")]
|
||||
[Authorize]
|
||||
public async Task<IActionResult> GetCompletionAsync(int id)
|
||||
{
|
||||
return NotFound();
|
||||
var model = await _completionService.GetCompletionByIdAsync(id);
|
||||
var result = CompletionMapper.ModelToOutputDto(model);
|
||||
return Ok(result);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue