minor services fix

This commit is contained in:
Вячеслав 2025-04-27 16:07:10 +05:00
parent edff901b52
commit a50bc30f88

View file

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