Skip to content

Commit

Permalink
build(web): update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
IKatsuba committed May 7, 2024
1 parent 6be8ed2 commit 8e5a1ef
Show file tree
Hide file tree
Showing 4 changed files with 8,356 additions and 5,696 deletions.
20 changes: 7 additions & 13 deletions apps/web/app/api/webhooks/stripe/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Client } from 'pg';
import { User } from '@supabase/supabase-js';
import postgres from 'postgres';
import Stripe from 'stripe';
import { v4 as uuidv4 } from 'uuid';

Expand Down Expand Up @@ -81,19 +82,12 @@ async function createSubscription(subscription: Stripe.Subscription) {
return Response.json({ received: true });
}

const client = new Client({
connectionString: process.env.POSTGRES_URL,
});
const sql = postgres(process.env.POSTGRES_URL!);

await client.connect();

const { rows } = await client.query(
`SELECT *
FROM auth.users
WHERE email = '${customer.email}' LIMIT 1`,
);

await client.end();
const rows = await sql<User[]>`
SELECT *
FROM auth.users
WHERE email = ${customer.email} LIMIT 1`;

const user = rows.at(0)!;

Expand Down
2 changes: 1 addition & 1 deletion apps/web/app/app/(dashboard)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default async function Component() {
const { data: workspaces } = await supabase
.from('workspaces')
.select('*, projects(id), domains(id), workspace_users(id), plans(name)')
.eq('user_id', user.id)
.eq('workspace_users.user_id', user.id)
.limit(8);

return (
Expand Down
Loading

0 comments on commit 8e5a1ef

Please sign in to comment.