Skip to content

Commit

Permalink
fix value is null
Browse files Browse the repository at this point in the history
  • Loading branch information
yoozo committed Feb 12, 2025
1 parent 916a760 commit 4f767e1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export async function handleCredit(

const account = await checkAndGetAccount(
effect.account,
effect.ledger.sequence
effect.ledger!.sequence
);

const credit = Credit.create({
Expand All @@ -48,7 +48,7 @@ export async function handleCredit(
amount: effect.amount,
});

account.lastSeenLedger = effect.ledger.sequence;
account.lastSeenLedger = effect.ledger!.sequence;
await Promise.all([account.save(), credit.save()]);
}

Expand All @@ -59,7 +59,7 @@ export async function handleDebit(

const account = await checkAndGetAccount(
effect.account,
effect.ledger.sequence
effect.ledger!.sequence
);

const debit = Debit.create({
Expand All @@ -68,7 +68,7 @@ export async function handleDebit(
amount: effect.amount,
});

account.lastSeenLedger = effect.ledger.sequence;
account.lastSeenLedger = effect.ledger!.sequence;
await Promise.all([account.save(), debit.save()]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export async function handleCredit(

const account = await checkAndGetAccount(
effect.account,
effect.ledger.sequence
effect.ledger!.sequence
);

const credit = Credit.create({
Expand All @@ -48,7 +48,7 @@ export async function handleCredit(
amount: effect.amount,
});

account.lastSeenLedger = effect.ledger.sequence;
account.lastSeenLedger = effect.ledger!.sequence;
await Promise.all([account.save(), credit.save()]);
}

Expand All @@ -59,7 +59,7 @@ export async function handleDebit(

const account = await checkAndGetAccount(
effect.account,
effect.ledger.sequence
effect.ledger!.sequence
);

const debit = Debit.create({
Expand All @@ -68,7 +68,7 @@ export async function handleDebit(
amount: effect.amount,
});

account.lastSeenLedger = effect.ledger.sequence;
account.lastSeenLedger = effect.ledger!.sequence;
await Promise.all([account.save(), debit.save()]);
}

Expand Down

0 comments on commit 4f767e1

Please sign in to comment.