diff --git a/SurveyBackend/SurveyBackend.Services/Services/SurveyService.cs b/SurveyBackend/SurveyBackend.Services/Services/SurveyService.cs index 9911697..fbdc2e7 100644 --- a/SurveyBackend/SurveyBackend.Services/Services/SurveyService.cs +++ b/SurveyBackend/SurveyBackend.Services/Services/SurveyService.cs @@ -26,7 +26,7 @@ public class SurveyService : ISurveyService public async Task UpdateSurveyAsync(Survey survey) { 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); } @@ -40,7 +40,7 @@ public class SurveyService : ISurveyService 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);