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