Skip to content

Commit 3e89ac8

Browse files
committedNov 19, 2024
Fix query and comment
1 parent 6a17132 commit 3e89ac8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎packages/ai-bot/lib/ai-cost.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {
2-
getMostRecentSubscription,
2+
getCurrentActiveSubscription,
33
getUserByMatrixUserId,
44
spendCredits,
55
} from '@cardstack/billing/billing-queries';
@@ -25,9 +25,9 @@ export async function saveUsageCost(
2525

2626
let user = await getUserByMatrixUserId(pgAdapter, matrixUserId);
2727

28-
// This check is for transition period where we don't have subscriptions have the subscription flow fully rolled out.
28+
// This check is for the transition period where we don't have subscriptions fully rolled out yet.
2929
// When we have assurance that all users who use the bot have subscriptions, we can remove this subscription check.
30-
let subscription = await getMostRecentSubscription(pgAdapter, user!.id);
30+
let subscription = await getCurrentActiveSubscription(pgAdapter, user!.id);
3131
if (!subscription) {
3232
log.info(
3333
`user ${matrixUserId} has no subscription, skipping credit usage tracking`,

0 commit comments

Comments
 (0)