Skip to content

Commit dd0afc6

Browse files
committed
Add test_mode billing query
1 parent c8e7ae4 commit dd0afc6

File tree

9 files changed

+1130
-1
lines changed

9 files changed

+1130
-1
lines changed

server/api/auth/sign-in-google.post.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export default defineEventHandler(async event => {
4141
user_name: subAttrs.user_name,
4242
variant_id: subAttrs.variant_id,
4343
variant_name: subAttrs.variant_name,
44+
test_mode: subAttrs.test_mode,
4445
})
4546
}
4647
}

server/api/billing/current-billing.get.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export default defineEventHandler(async event => {
3838
user_name: subAttrs.user_name,
3939
variant_id: subAttrs.variant_id,
4040
variant_name: subAttrs.variant_name,
41+
test_mode: subAttrs.test_mode,
4142
})
4243
}
4344

server/api/billing/subscription-sync.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ export async function syncUserSubscription(
105105
product_name: attributes.product_name,
106106
user_name: attributes.user_name,
107107
variant_name: attributes.variant_name,
108+
testMode: attributes.test_mode,
108109
}
109110
await db.insert(tables.users_subs)
110111
.values(newSub)
@@ -131,4 +132,5 @@ export type SubscriptionSyncData = {
131132
ends_at: string | null;
132133
created_at: string;
133134
updated_at: string;
135+
test_mode: boolean;
134136
}

server/api/create-org.post.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default defineEventHandler(async (event) => {
2222
const { orgLimit: orgSize } = await getUserMaxOrg(event)
2323
if (myCurrentUserOrgs.count >= orgSize) {
2424
throw createError({
25-
message: `The number of organization has reached the limit ${orgSize} of ${myCurrentUserOrgs.count} organizations`,
25+
message: `The number of organization has reached the limit ${orgSize} of organizations`,
2626
})
2727
}
2828
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE `users_app_subs` ADD `test_mode` integer;

0 commit comments

Comments
 (0)