add completions methods (not final)
This commit is contained in:
parent
58b5b2b17d
commit
c2f6ba6dde
4 changed files with 23 additions and 5 deletions
|
|
@ -1,3 +1,4 @@
|
|||
using SurveyBackend.Services.Exceptions;
|
||||
using SurveyLib.Core.Models;
|
||||
using SurveyLib.Core.Repositories;
|
||||
using SurveyLib.Core.Services;
|
||||
|
|
@ -31,6 +32,17 @@ public class CompletionService : ICompletionService
|
|||
await _completionRepository.DeleteAsync(id);
|
||||
}
|
||||
|
||||
public async Task<Completion> GetCompletionByIdAsync(int id)
|
||||
{
|
||||
var completion = await _completionRepository.GetByIdAsync(id);
|
||||
if (completion is null)
|
||||
{
|
||||
throw new NotFoundException("Completion not found");
|
||||
}
|
||||
|
||||
return completion;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Completion>> GetCompletionsBySurveyIdAsync(int surveyId)
|
||||
{
|
||||
// TODO: проверить существование опроса
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue