소스 검색

Create AccountMessage in DB only if Account is still there

pull/55/head
Kristijan Mitrovic 4 년 전
부모
커밋
a7087df1b8
1개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. +5
    -3
      bubble-server/src/main/java/bubble/service/account/StandardAccountMessageService.java

+ 5
- 3
bubble-server/src/main/java/bubble/service/account/StandardAccountMessageService.java 파일 보기

@@ -167,13 +167,15 @@ public class StandardAccountMessageService implements AccountMessageService {
approval.setRequestContact(policy.findContactByUuid(approval.getRequest().getContact()));
getCompletionHandler(approval).confirm(approval, data);

final AccountMessage confirm = messageDAO.create(
new AccountMessage(approval).setMessageType(AccountMessageType.confirmation));
final AccountMessage confirm = new AccountMessage(approval).setMessageType(AccountMessageType.confirmation);
if (approval.hasConfirmationTokensToRemove()) {
final RedisService tokens = getConfirmationTokens();
for (String toRemove : approval.getConfirmationTokensToRemove()) tokens.del(toRemove);
}
return confirm;

// Write AccountMessage entity into database only if Account is still available in there
// (i.e. not removed with block_delete deletion policy)
return accountDAO.exists(confirm.getAccount()) ? messageDAO.create(confirm) : confirm;

} else if (approvalStatus.ok()) {
if (approval.hasConfirmationTokensToRemove()) {


불러오는 중...
취소
저장