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:
parent
fe74490440
commit
658e25dd57
3 changed files with 3 additions and 3 deletions
|
|
@ -38,7 +38,7 @@ public class QuestionService : IQuestionService
|
||||||
throw new NotFoundException("Question not found");
|
throw new NotFoundException("Question not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
await _questionRepository.DeleteAsync(question);
|
await _questionRepository.DeleteAsync(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<QuestionBase> GetQuestionByIdAsync(int id)
|
public async Task<QuestionBase> GetQuestionByIdAsync(int id)
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ public class SurveyService : ISurveyService
|
||||||
throw new UnauthorizedException("You are not authorized to delete this survey.");
|
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()
|
public async Task<IEnumerable<Survey>> GetSurveysAsync()
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit eb48f28d66c1eeb4673659534bef24a2f721c647
|
Subproject commit c477e8caddccf193eef192132e8382fc0803cea9
|
||||||
Loading…
Add table
Add a link
Reference in a new issue