Neah version mail remove mail correction 2 ?
This commit is contained in:
parent
54195c43b1
commit
f9ebf07855
@ -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) {
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user