Skip to content

Commit

Permalink
fix entityId retrieval for when no "id" was selected via fields
Browse files Browse the repository at this point in the history
  • Loading branch information
thjaeckle committed Feb 20, 2024
1 parent 335a26c commit c7c0d6d
Showing 1 changed file with 7 additions and 5 deletions.
Expand Up @@ -336,11 +336,13 @@ private void handleCommandAndAcceptImmediately(final Signal<?> command) {
}

private void rememberResponseLocationUri(final CommandResponse<?> commandResponse) {
final var optionalEntityId = WithEntityId.getEntityId(commandResponse);
if (HttpStatus.CREATED.equals(commandResponse.getHttpStatus()) && optionalEntityId.isPresent()) {
responseLocationUri =
getUriForLocationHeader(httpRequest, optionalEntityId.get(), commandResponse.getResourcePath());
logger.debug("Setting responseLocationUri=<{}> from request <{}>", responseLocationUri, httpRequest);
if (HttpStatus.CREATED.equals(commandResponse.getHttpStatus())) {
final var optionalEntityId = WithEntityId.getEntityId(commandResponse);
if (optionalEntityId.isPresent()) {
responseLocationUri =
getUriForLocationHeader(httpRequest, optionalEntityId.get(), commandResponse.getResourcePath());
logger.debug("Setting responseLocationUri=<{}> from request <{}>", responseLocationUri, httpRequest);
}
}
}

Expand Down

0 comments on commit c7c0d6d

Please sign in to comment.