Skip to content

Commit

Permalink
--wip-- [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
oskogstad committed Jan 7, 2025
1 parent 3c3214e commit 0fff9b7
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ public async Task<IActionResult> Patch(
var command = new UpdateDialogCommand { Id = dialogId, IfMatchDialogRevision = etag, Dto = updateDialogDto };
var result = await _sender.Send(command, ct);
return result.Match(
success => (IActionResult)NoContent(),
success =>
{
HttpContext.Response.Headers.Append(Constants.ETag, success.Revision.ToString());
return (IActionResult)NoContent();
},
notFound => NotFound(HttpContext.GetResponseOrDefault(StatusCodes.Status404NotFound, notFound.ToValidationResults())),
badRequest => BadRequest(HttpContext.GetResponseOrDefault(StatusCodes.Status400BadRequest, badRequest.ToValidationResults())),
validationFailed => BadRequest(HttpContext.GetResponseOrDefault(StatusCodes.Status400BadRequest, validationFailed.Errors.ToList())),
Expand Down

0 comments on commit 0fff9b7

Please sign in to comment.