Update SurveyLib and start refactoring endpoint paths

This commit is contained in:
Вячеслав 2025-05-31 01:03:12 +05:00
parent c2f6ba6dde
commit 637e6c9824
5 changed files with 22 additions and 15 deletions

View file

@ -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);
}