patch stale remaining example in payments docs

This commit is contained in:
Madison 2026-05-25 14:20:16 -05:00
parent b6b3dad5c0
commit 0b30a559ac
3 changed files with 6 additions and 3 deletions

View File

@ -111,7 +111,8 @@ export async function consumeCredits(userId: string, amount: number) {
throw new Error("Insufficient credits");
}
return { remaining: credits.quantity };
const updatedCredits = await user.getItem("credits");
return { remaining: updatedCredits.quantity };
}
```

View File

@ -219,7 +219,8 @@ export async function consumeCredits(userId: string, amount: number) {
throw new Error("Insufficient credits");
}
return { remaining: credits.quantity };
const updatedCredits = await user.getItem("credits");
return { remaining: updatedCredits.quantity };
}
```

View File

@ -237,7 +237,8 @@ export async function consumeCredits(userId: string, amount: number) {
throw new Error("Insufficient credits");
}
return { remaining: credits.quantity };
const updatedCredits = await user.getItem("credits");
return { remaining: updatedCredits.quantity };
}
```