don't use outdated purchase info

This commit is contained in:
Sebastian 2023-02-20 12:36:48 -03:00
parent 2c57d42128
commit 0b6b757f65
No known key found for this signature in database
GPG Key ID: BE4FF68352439FC1

View File

@ -2697,8 +2697,13 @@ export async function processPurchaseQueryRefund(
await ws.db
.mktx((x) => [x.purchases])
.runReadWrite(async (tx) => {
purchase.purchaseStatus = PurchaseStatus.Paid;
await tx.purchases.put(purchase);
const p = await tx.purchases.get(proposalId);
if (!p) {
logger.warn("purchase does not exist anymore");
return;
}
p.purchaseStatus = PurchaseStatus.Paid;
await tx.purchases.put(p);
});
// No new refunds, but we still need to notify