mail page rest dang
This commit is contained in:
parent
a4f751ba4b
commit
fbc1140ccb
@ -545,7 +545,6 @@ export default function CourrierPage() {
|
|||||||
const handleEmailSelect = async (emailId: number) => {
|
const handleEmailSelect = async (emailId: number) => {
|
||||||
const email = emails.find(e => e.id === emailId);
|
const email = emails.find(e => e.id === emailId);
|
||||||
if (!email) {
|
if (!email) {
|
||||||
console.error('Email not found in list');
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -553,7 +552,7 @@ export default function CourrierPage() {
|
|||||||
setSelectedEmail(email);
|
setSelectedEmail(email);
|
||||||
|
|
||||||
// Fetch the full email content
|
// Fetch the full email content
|
||||||
const response = await fetch(`/api/courrier/${emailId}`);
|
const response = await fetch(`/api/mail/${emailId}`);
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new Error('Failed to fetch full email content');
|
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 to mark as read in the background
|
||||||
try {
|
try {
|
||||||
const markReadResponse = await fetch(`/api/courrier/mark-read`, {
|
const markReadResponse = await fetch(`/api/mail/mark-read`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Authorization': `Bearer ${session?.user?.id}` // Add session token
|
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
emailId,
|
emailId,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user