From f9ebf078556f4417fd27bc8a3702baa59ebabba6 Mon Sep 17 00:00:00 2001 From: alma Date: Wed, 16 Apr 2025 20:35:39 +0200 Subject: [PATCH] Neah version mail remove mail correction 2 ? --- app/api/mail/bulk-actions/route.ts | 4 +--- app/api/mail/mark-read/route.ts | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/api/mail/bulk-actions/route.ts b/app/api/mail/bulk-actions/route.ts index 260c5ca..0739a0d 100644 --- a/app/api/mail/bulk-actions/route.ts +++ b/app/api/mail/bulk-actions/route.ts @@ -1,5 +1,4 @@ import { NextResponse } from 'next/server'; -import { cookies } from 'next/headers'; import { getImapClient } from '@/lib/imap'; export async function POST(request: Request) { @@ -33,7 +32,7 @@ export async function POST(request: Request) { const lock = await imap.getMailboxLock(folder); try { - // First, fetch all messages to get their UIDs + // Fetch messages to get their UIDs const messages = await imap.fetch({ seq: numericIds.map(id => id.toString()), uid: true, @@ -62,7 +61,6 @@ export async function POST(request: Request) { return NextResponse.json({ success: true }); } finally { - // Always release the mailbox lock lock.release(); } } catch (error) { diff --git a/app/api/mail/mark-read/route.ts b/app/api/mail/mark-read/route.ts index a15789e..21399e5 100644 --- a/app/api/mail/mark-read/route.ts +++ b/app/api/mail/mark-read/route.ts @@ -1,5 +1,4 @@ import { NextResponse } from 'next/server'; -import { cookies } from 'next/headers'; import { getImapClient } from '@/lib/imap'; export async function POST(request: Request) { @@ -33,7 +32,7 @@ export async function POST(request: Request) { const lock = await imap.getMailboxLock(folder); try { - // Fetch the message to get its UID + // Fetch message to get its UID const messages = await imap.fetch({ seq: numericId.toString(), uid: true, @@ -53,7 +52,6 @@ export async function POST(request: Request) { return NextResponse.json({ success: true }); } finally { - // Always release the mailbox lock lock.release(); } } catch (error) {