public async Task <Report> CreateOtherReport(CreateOtherReportRequest request) { var baseReport = await CreateBaseReport(request.Subject, request.Content, request.IsPrivate, request.EventDate, request.Type); if (!await database.ReportRepository.Insert(baseReport, false)) { throw new DatabaseException(); } await reportImageService.UploadReportImages(httpContextReader.CurrentUserId, baseReport, request.Images); return(baseReport); }
public async Task <AttachReportImagesResponse> Handle(AttachReportImagesRequest request, CancellationToken cancellationToken) { var report = await reportValidationHub.ValidateAndReturnReport(request.ReportId, ReportPermission.AddComment) ?? throw new NoPermissionsException(ErrorMessages.NotAllowedMessage); ; return(await reportImageService.UploadReportImages(httpContextReader.CurrentUserId, report, request.Images) ? new AttachReportImagesResponse() : throw new UploadFileException()); }