mail page rest dang

This commit is contained in:
alma 2025-04-21 16:14:27 +02:00
parent a4f751ba4b
commit fbc1140ccb

View File

@ -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,