Refactor code for improved readability and consistency

- Updated formatting in SessionDetails component for better readability.
- Enhanced documentation in scheduler-fixes.md to clarify issues and solutions.
- Improved error handling and logging in csvFetcher.js and processingScheduler.js.
- Standardized code formatting across various scripts and components for consistency.
- Added validation checks for CSV URLs and transcript content to prevent processing errors.
- Enhanced logging messages for better tracking of processing status and errors.
This commit is contained in:
Max Kowalski
2025-06-25 17:46:23 +02:00
parent a9e4145001
commit 9e095e1a43
16 changed files with 455 additions and 259 deletions

View File

@ -21,9 +21,9 @@ export default async function handler(
where: { id },
include: {
messages: {
orderBy: { order: 'asc' }
}
}
orderBy: { order: "asc" },
},
},
});
if (!prismaSession) {
@ -63,15 +63,16 @@ export default async function handler(
processed: prismaSession.processed ?? null, // New field
questions: prismaSession.questions ?? null, // New field
summary: prismaSession.summary ?? null, // New field
messages: prismaSession.messages?.map(msg => ({
id: msg.id,
sessionId: msg.sessionId,
timestamp: new Date(msg.timestamp),
role: msg.role,
content: msg.content,
order: msg.order,
createdAt: new Date(msg.createdAt)
})) ?? [], // New field - parsed messages
messages:
prismaSession.messages?.map((msg) => ({
id: msg.id,
sessionId: msg.sessionId,
timestamp: new Date(msg.timestamp),
role: msg.role,
content: msg.content,
order: msg.order,
createdAt: new Date(msg.createdAt),
})) ?? [], // New field - parsed messages
};
return res.status(200).json({ session });