Исправление бага в AnswerSaveAction
This commit is contained in:
parent
4ab042c611
commit
b4d5999d98
@ -24,28 +24,30 @@ public class AnswerSaveAction<D> implements ActionUnit<AnswerSave<Message, D>, M
|
|||||||
final AnswerSave<Message, D> answerSave = unitRequest.getUnit();
|
final AnswerSave<Message, D> answerSave = unitRequest.getUnit();
|
||||||
final Message message = unitRequest.getMessage();
|
final Message message = unitRequest.getMessage();
|
||||||
|
|
||||||
final AnswerSavePreservable<D> preservable = answerSave.getPreservable();
|
|
||||||
final String personId = message.getFromPersonId();
|
|
||||||
|
|
||||||
final CheckSave<Message> checkSave = answerSave.getCheckSave();
|
final CheckSave<Message> checkSave = answerSave.getCheckSave();
|
||||||
if (checkNotNull(checkSave)) {
|
if (checkNotNull(checkSave)) {
|
||||||
return Uni.createFrom().voidItem()
|
return Uni.createFrom().voidItem()
|
||||||
.onItem().transformToUni(
|
.onItem().transformToUni(
|
||||||
v -> checkSave.check(message)
|
v -> checkSave.check(message)
|
||||||
.onItem().transform(
|
.onItem().ifNotNull().transformToUni(
|
||||||
unit -> {
|
unit -> {
|
||||||
if (checkNotNull(unit)) {
|
if (checkNotNull(unit)) {
|
||||||
return UnitRequest.of(unit, message);
|
return Uni.createFrom().item(UnitRequest.of(unit, message));
|
||||||
}
|
}
|
||||||
return UnitRequest.of(answerSave, message);
|
return getUnitRequestUni(answerSave, message);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return getUnitRequestUni(answerSave, message);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Uni<UnitRequest<MainUnit, Message>> getUnitRequestUni(AnswerSave<Message, D> answerSave, Message message) {
|
||||||
|
final String personId = message.getFromPersonId();
|
||||||
|
final AnswerSavePreservable<D> preservable = answerSave.getPreservable();
|
||||||
final PreservableData<D, Message> preservableData = answerSave.getPreservableData();
|
final PreservableData<D, Message> preservableData = answerSave.getPreservableData();
|
||||||
final Pusher<D> pusher = answerSave.getPusher();
|
final Pusher<D> pusher = answerSave.getPusher();
|
||||||
|
|
||||||
return Uni.createFrom().voidItem()
|
return Uni.createFrom().voidItem()
|
||||||
.onItem().transformToUni(
|
.onItem().transformToUni(
|
||||||
v -> {
|
v -> {
|
||||||
|
Loading…
Reference in New Issue
Block a user