fix: credit balance issues (#21904)

* fix creating user balance

* fix org check if teamId is given

* adjust hasAvailableCredits function

* improve comments

* fix creditBalance.create

* adjust test

---------

Co-authored-by: CarinaWolli <wollencarina@gmail.com>
This commit is contained in:
Carina WollendorferandCarinaWolli authored and GitHub committed 2025-06-24 09:18:14 +02:00
1 parent a37f1d9798
commit c215dc5864
4 files changed
+22 -3

No files matched your search

+1 -1
View File
@@ -121,7 +121,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
if (!orgId) {
orgId = await getOrgIdFromMemberOrTeamId({
memberId: parsedUserId,
...(!parsedTeamId ? { memberId: parsedUserId } : {}),
teamId: parsedTeamId,
});
}