Skip to content

Commit

Permalink
changes for HL7Configuration endpoint
Browse files Browse the repository at this point in the history
Signed-off-by: Lillie Dae <lillie.dae@answerdigital.com>
  • Loading branch information
lillie-dae committed Nov 16, 2023
1 parent 3c9a77a commit 95e4c7d
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using Microsoft.Extensions.Options;
using Monai.Deploy.InformaticsGateway.Api;
using Monai.Deploy.InformaticsGateway.Configuration;
using Monai.Deploy.InformaticsGateway.Database.Api;
using Monai.Deploy.InformaticsGateway.Database.Api.Logging;
using Monai.Deploy.InformaticsGateway.Database.Api.Repositories;
using Polly;
Expand Down Expand Up @@ -63,6 +64,10 @@ public Task<Hl7ApplicationConfigEntity> DeleteAsync(string id, CancellationToken
return _retryPolicy.ExecuteAsync(async () =>
{
var entity = await GetByIdAsync(id).ConfigureAwait(false);
if (entity is null)
{
throw new DatabaseException("Failed to delete entity.");
}
var result = _dataset.Remove(entity);
await _informaticsGatewayContext.SaveChangesAsync(cancellationToken).ConfigureAwait(false);
return result.Entity;
Expand Down

0 comments on commit 95e4c7d

Please sign in to comment.