Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
리팩토링
Browse files Browse the repository at this point in the history
  • Loading branch information
ori0o0p committed Mar 4, 2024
2 parents e01032e + 410648a commit efdf7be
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public Mono<Void> execute(EditContentTableTitleRequest request, String documentI
commons.userPermissionAndDocumentVersionCheck(document, user.getEmail(), request.version());
return document;
})
.flatMap(document -> {
.map(document -> {
document.getContent()
.stream()
.filter(c -> c.getIndex().equals(request.index()))
Expand All @@ -39,13 +39,15 @@ public Mono<Void> execute(EditContentTableTitleRequest request, String documentI

document.increaseVersion();

return documentFacade.saveDocument(document)
.then(revisionComponent.saveHistory(SaveRevisionHistoryRequest.builder()
.type(RevisionType.UPDATE)
.documentId(documentId)
.title(document.getTitle())
.build()));
});
return document;
})
.flatMap(document -> documentFacade.saveDocument(document)
.then(revisionComponent.saveHistory(SaveRevisionHistoryRequest.builder()
.type(RevisionType.UPDATE)
.documentId(documentId)
.title(document.getTitle())
.build()))
);
}

}

0 comments on commit efdf7be

Please sign in to comment.