Skip to content

Commit

Permalink
remove additional save
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee Wright authored and Lee Wright committed Jul 22, 2024
1 parent 0edf5e0 commit 2846053
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public async Task<IDomainResult> HandleAsync(Command command)
var addedRows = await this.context.SaveChangesAsync();
if (addedRows > 0)
{
this.logger.LogRequestCase(command.RequestId, command.AgencyFileNumber, command.PartyId);
this.logger.LogRequestCase(command.RequestId, command.AgencyFileNumber, command.PartyId, subAgencyRequest.RequestId);
await trx.CommitAsync();

await this.PublishSubAgencyAccessRequest(dto, subAgencyRequest);
Expand Down Expand Up @@ -202,8 +202,6 @@ private async Task<SubmittingAgencyRequest> SubmitAgencyCaseRequest(Command comm

this.context.SubmittingAgencyRequests.Add(subAgencyAccessRequest);

await this.context.SaveChangesAsync();

return subAgencyAccessRequest;
}

Expand Down Expand Up @@ -237,6 +235,6 @@ public static partial class SubmittingAgencyLoggingExtensions
public static partial void LogCaseMissingKey(this ILogger logger, int caseId, string? username);
[LoggerMessage(4, LogLevel.Information, "Tools case {caseId} request - for user {username}.")]
public static partial void LogRequestToolsCase(this ILogger logger, int caseId, string? username);
[LoggerMessage(5, LogLevel.Information, "Saved request {requestId} for {agencyFileNumber} party: {partyId}")]
public static partial void LogRequestCase(this ILogger logger, int requestId, string? agencyFileNumber, int partyId);
[LoggerMessage(5, LogLevel.Information, "Saved request {subAgencyRequestId} for {requestId} for {agencyFileNumber} party: {partyId}")]
public static partial void LogRequestCase(this ILogger logger, int requestId, string? agencyFileNumber, int partyId, int subAgencyRequestId);
}

0 comments on commit 2846053

Please sign in to comment.