Skip to content

Commit

Permalink
[SPDBT-3389] Fix bug for file copying (#1911)
Browse files Browse the repository at this point in the history
# Description

This PR includes the following proposed change(s):

- [SPDBT-3389] Fix bug for file copying
  • Loading branch information
peggy-quartech authored Nov 28, 2024
1 parent 3a9c05c commit 91f694e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Spd.Resource.Repository/Document/DocumentRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private async Task<DocumentResp> DocumentCreateAsync(CreateDocumentCmd cmd, Canc
bcgov_documenturl documenturl = _mapper.Map<bcgov_documenturl>(cmd.TempFile);
documenturl.bcgov_url = cmd.ApplicationId == null ? $"contact/{cmd.ApplicantId}" : $"spd_application/{cmd.ApplicationId}";
if (cmd.ExpiryDate != null && cmd.ExpiryDate < new DateOnly(1800, 1, 1))
throw new ArgumentException("Invalid Document Expiry Date");
throw new ArgumentException("Invalid Document Expiry Date");
if (cmd.ExpiryDate != null) documenturl.spd_expirydate = SharedMappingFuncs.GetDateFromDateOnly(cmd.ExpiryDate);
_context.AddTobcgov_documenturls(documenturl);
if (cmd.ApplicationId != null)
Expand Down Expand Up @@ -226,7 +226,7 @@ private async Task<DocumentResp> DocumentCopyAsync(CopyDocumentCmd cmd, Cancella

await _fileStorageService.HandleCommand(new CopyFileCommand(
SourceKey: cmd.SourceDocumentUrlId.ToString(),
SourceFolder: $"spd_application/{sourceDoc._spd_applicationid_value}",
SourceFolder: sourceDoc.bcgov_url,
DestKey: destDoc.bcgov_documenturlid.ToString(),
DestFolder: $"spd_application/{cmd.DestApplicationId}"
), ct);
Expand Down

0 comments on commit 91f694e

Please sign in to comment.