mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
patch stale remaining example in payments docs
This commit is contained in:
parent
b6b3dad5c0
commit
0b30a559ac
@ -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 };
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -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 };
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -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 };
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user