Fondation
This commit is contained in:
parent
a0b11c7b5f
commit
2cfcc60b65
@ -23,8 +23,7 @@ const CACHE_TTL = 60 * 1000;
|
||||
const emailListCache: Record<string, EmailCacheEntry> = {};
|
||||
|
||||
export async function GET(request: Request) {
|
||||
try {
|
||||
// Authenticate user
|
||||
// Authenticate user (declare outside try to access in catch)
|
||||
const session = await getServerSession(authOptions);
|
||||
if (!session || !session.user?.id) {
|
||||
return NextResponse.json(
|
||||
@ -33,6 +32,8 @@ export async function GET(request: Request) {
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
// Extract query parameters
|
||||
const { searchParams } = new URL(request.url);
|
||||
const page = parseInt(searchParams.get("page") || "1");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user