summaryrefslogtreecommitdiffhomepage
path: root/packages/console/app/src/routes/stripe/webhook.ts
diff options
context:
space:
mode:
authorFrank <[email protected]>2026-01-08 19:24:20 -0500
committerFrank <[email protected]>2026-01-09 01:32:00 -0500
commit52fbd16e08fe59d2d0a7a588dfa565a8ff2d2c95 (patch)
tree86d28ed49f348ad779bcd9f22f23da9b5b601a13 /packages/console/app/src/routes/stripe/webhook.ts
parentcf97633d7d81c68aa154b82eeb718ba99beb13d8 (diff)
downloadopencode-52fbd16e08fe59d2d0a7a588dfa565a8ff2d2c95.tar.gz
opencode-52fbd16e08fe59d2d0a7a588dfa565a8ff2d2c95.zip
wip: zen
wip: zen
Diffstat (limited to 'packages/console/app/src/routes/stripe/webhook.ts')
-rw-r--r--packages/console/app/src/routes/stripe/webhook.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/packages/console/app/src/routes/stripe/webhook.ts b/packages/console/app/src/routes/stripe/webhook.ts
index c468d2d0c..6f1637641 100644
--- a/packages/console/app/src/routes/stripe/webhook.ts
+++ b/packages/console/app/src/routes/stripe/webhook.ts
@@ -1,8 +1,7 @@
import { Billing } from "@opencode-ai/console-core/billing.js"
import type { APIEvent } from "@solidjs/start/server"
import { and, Database, eq, sql } from "@opencode-ai/console-core/drizzle/index.js"
-import { BillingTable, PaymentTable } from "@opencode-ai/console-core/schema/billing.sql.js"
-import { UserTable } from "@opencode-ai/console-core/schema/user.sql.js"
+import { BillingTable, PaymentTable, SubscriptionTable } from "@opencode-ai/console-core/schema/billing.sql.js"
import { Identifier } from "@opencode-ai/console-core/identifier.js"
import { centsToMicroCents } from "@opencode-ai/console-core/util/price.js"
import { Actor } from "@opencode-ai/console-core/actor.js"
@@ -380,7 +379,7 @@ export async function POST(input: APIEvent) {
await Database.transaction(async (tx) => {
await tx.update(BillingTable).set({ subscriptionID: null }).where(eq(BillingTable.workspaceID, workspaceID))
- await tx.update(UserTable).set({ timeSubscribed: null }).where(eq(UserTable.workspaceID, workspaceID))
+ await tx.delete(SubscriptionTable).where(eq(SubscriptionTable.workspaceID, workspaceID))
})
}
})()