minor services fix
This commit is contained in:
parent
edff901b52
commit
a50bc30f88
1 changed files with 2 additions and 2 deletions
|
|
@ -26,7 +26,7 @@ public class SurveyService : ISurveyService
|
||||||
public async Task UpdateSurveyAsync(Survey survey)
|
public async Task UpdateSurveyAsync(Survey survey)
|
||||||
{
|
{
|
||||||
if (survey.CreatedBy != _userContext.UserId)
|
if (survey.CreatedBy != _userContext.UserId)
|
||||||
throw new UnauthorizedAccessException("You are not authorized to update this survey.");
|
throw new UnauthorizedException("You are not authorized to update this survey.");
|
||||||
await _surveyRepository.UpdateAsync(survey);
|
await _surveyRepository.UpdateAsync(survey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -40,7 +40,7 @@ public class SurveyService : ISurveyService
|
||||||
|
|
||||||
if (survey.CreatedBy != _userContext.UserId)
|
if (survey.CreatedBy != _userContext.UserId)
|
||||||
{
|
{
|
||||||
throw new UnauthorizedAccessException("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(survey);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue