diff --git a/app/courrier/page.tsx b/app/courrier/page.tsx index bab5b1ad..322450cf 100644 --- a/app/courrier/page.tsx +++ b/app/courrier/page.tsx @@ -545,7 +545,6 @@ export default function CourrierPage() { const handleEmailSelect = async (emailId: number) => { const email = emails.find(e => e.id === emailId); if (!email) { - console.error('Email not found in list'); return; } @@ -553,7 +552,7 @@ export default function CourrierPage() { setSelectedEmail(email); // Fetch the full email content - const response = await fetch(`/api/courrier/${emailId}`); + const response = await fetch(`/api/mail/${emailId}`); if (!response.ok) { throw new Error('Failed to fetch full email content'); } @@ -571,11 +570,10 @@ export default function CourrierPage() { // Try to mark as read in the background try { - const markReadResponse = await fetch(`/api/courrier/mark-read`, { + const markReadResponse = await fetch(`/api/mail/mark-read`, { method: 'POST', headers: { 'Content-Type': 'application/json', - 'Authorization': `Bearer ${session?.user?.id}` // Add session token }, body: JSON.stringify({ emailId,