Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Fargekritt committed Jan 13, 2025
1 parent 3a2422b commit 78f0d20
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ public async Task<CreateDialogResult> Handle(CreateDialogCommand request, Cancel

if (request.IdempotentKey is not null && !string.IsNullOrEmpty(dialog.Org))
{
var dialogQuery = await _db.Dialogs
var dialogId = await _db.Dialogs
.Where(x => x.IdempotentKey == request.IdempotentKey && x.Org == dialog.Org).Select(x => x.Id)
.FirstOrDefaultAsync(cancellationToken);

if (dialogQuery != default)
if (dialogId != default)
{
return new Conflict($"IdempotencyId: '{request.IdempotentKey}' already exists with DialogId '{dialogQuery}'");
return new Conflict($"IdempotencyId: '{request.IdempotentKey}' already exists with DialogId '{dialogId}'");
}
dialog.IdempotentKey = request.IdempotentKey;
}
Expand Down

0 comments on commit 78f0d20

Please sign in to comment.