Fix deletion methods to directly use ID in services

Updated QuestionService and SurveyService to pass the ID directly to the repository's DeleteAsync method. This improves clarity and ensures consistency in how deletions are handled across both services.

Updated SurveyLib
This commit is contained in:
Вячеслав 2025-05-20 16:09:27 +05:00
parent fe74490440
commit 658e25dd57
3 changed files with 3 additions and 3 deletions

View file

@ -38,7 +38,7 @@ public class QuestionService : IQuestionService
throw new NotFoundException("Question not found");
}
await _questionRepository.DeleteAsync(question);
await _questionRepository.DeleteAsync(id);
}
public async Task<QuestionBase> GetQuestionByIdAsync(int id)

View file

@ -43,7 +43,7 @@ public class SurveyService : ISurveyService
throw new UnauthorizedException("You are not authorized to delete this survey.");
}
await _surveyRepository.DeleteAsync(survey);
await _surveyRepository.DeleteAsync(id);
}
public async Task<IEnumerable<Survey>> GetSurveysAsync()