Skip to content

Commit

Permalink
Fix error that erased app content when update.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomasr authored and ludomikula committed Sep 16, 2024
1 parent dc87672 commit 715ff05
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,10 @@ public Flux<Application> findAll() {

@Override
public Mono<Boolean> updateLastEditedAt(String applicationId, Instant time, String visitorId) {
return repository.findById(applicationId)
return repository.findByIdIn(List.of(applicationId))
.filter(application -> application.getEditingUserId().equals(visitorId))
.doOnNext(application -> application.setLastEditedAt(time))
.flatMap(repository::save)
.hasElement();
.hasElements();
}
}

0 comments on commit 715ff05

Please sign in to comment.