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
|
|
@ -28,7 +28,14 @@ public class QuestionService : IQuestionService
|
|||
|
||||
public async Task UpdateQuestionAsync(QuestionBase question)
|
||||
{
|
||||
// TODO: проверить существование вопроса
|
||||
var questionBase = await _questionRepository.GetByIdAsNoTrackingAsync(question.Id);
|
||||
if (questionBase is null)
|
||||
{
|
||||
throw new NotFoundException("Question not found");
|
||||
}
|
||||
|
||||
question.SurveyId = questionBase.SurveyId;
|
||||
|
||||
await _questionRepository.UpdateAsync(question);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue