We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c8d060e commit 5df270aCopy full SHA for 5df270a
app/api/emails/route.ts
@@ -14,15 +14,11 @@ export async function GET(request: Request) {
14
const { searchParams } = new URL(request.url)
15
const cursor = searchParams.get('cursor')
16
17
- if (!session?.user?.email) {
18
- return NextResponse.json({ emails: [], nextCursor: null, total: 0 })
19
- }
20
-
21
const db = createDb()
22
23
try {
24
const baseConditions = and(
25
- eq(emails.userId, session.user.id!),
+ eq(emails.userId, session!.user!.id!),
26
gt(emails.expiresAt, new Date())
27
)
28
0 commit comments