Skip to content

Commit c5922fd

Browse files
Revert commits 43e1623..c5a8b83 — roll back changes from last 24h
1 parent c5a8b83 commit c5922fd

File tree

27 files changed

+228
-1717
lines changed

27 files changed

+228
-1717
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,3 @@ prisma/.env
5252

5353
# OS
5454
Thumbs.db
55-
56-
# clerk configuration (can include secrets)
57-
/.clerk/

prisma/migrations/20251111162235_plan_usage_limits/migration.sql

Lines changed: 0 additions & 197 deletions
This file was deleted.

prisma/migrations/migration_lock.toml

Lines changed: 0 additions & 3 deletions
This file was deleted.

prisma/schema.prisma

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,16 @@ datasource db {
99
extensions = [vector]
1010
}
1111

12-
enum PlanType {
13-
FREE
14-
BASIC
15-
PREMIUM
16-
ENTERPRISE
17-
}
18-
1912
model User {
20-
id String @id @default(uuid())
21-
createdAt DateTime @default(now())
22-
updatedAt DateTime @updatedAt
13+
id String @id @default(uuid())
14+
createdAt DateTime @default(now())
15+
updatedAt DateTime @updatedAt
2316
imageUrl String?
2417
firstName String?
2518
lastName String?
26-
emailAddress String @unique
27-
credits Int @default(150)
28-
plan PlanType @default(FREE)
29-
planUpdated DateTime @default(now())
19+
emailAddress String @unique
20+
credits Int @default(150)
3021
projects Project[]
31-
usage UsageQuota[]
3222
}
3323

3424
model Project {
@@ -126,17 +116,3 @@ model DocsShare {
126116
docsId String @unique
127117
docs Docs @relation(fields: [docsId], references: [id], onDelete: Cascade)
128118
}
129-
130-
model UsageQuota {
131-
id String @id @default(uuid())
132-
createdAt DateTime @default(now())
133-
updatedAt DateTime @updatedAt
134-
periodStart DateTime
135-
userId String
136-
readmeCount Int @default(0)
137-
docsCount Int @default(0)
138-
chatCount Int @default(0)
139-
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
140-
141-
@@unique([userId, periodStart])
142-
}

src/app/(auth)/sync-user/page.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { auth, currentUser } from '@clerk/nextjs/server'
1+
import { auth, clerkClient } from '@clerk/nextjs/server'
22
import { notFound, redirect } from 'next/navigation'
33
import prisma from '@/lib/prisma'
44
import React from 'react'
@@ -9,10 +9,9 @@ async function page() {
99
return redirect('/')
1010
}
1111

12-
const user = await currentUser()
13-
if (!user) {
14-
return notFound()
15-
}
12+
const client = await clerkClient()
13+
14+
const user = await client.users.getUser(userId)
1615

1716
if(!user.emailAddresses[0]?.emailAddress) {
1817
return notFound()

0 commit comments

Comments
 (0)