mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
⬆️ feat: Cancel chat file uploads; fix: Assistant uploads (#4433)
* refactor: move file mutations to dedicated file, improve typing * refactor(ChatForm): utilize FileFormWrapper to consolidate file upload logic/rendering to single parent * refactor: better TSX heirarchies between AttachFile and FileFormWrapper * refactor: `abortUpload` WIP * fix: file debugging and file upload issues * refactor: reject promise outright if axios intercepted error does not include response property * chore: bump data-provider version to 0.7.428 * refactor: Add return type to localize function in Translation.ts * refactor: allow message file attachment upload request cancellations, and add localizations for file upload errors * refactor: include Azure OpenAI in paramEndpoints set * fix: assistant form uploads and better typing * refactor: consolidate logic
This commit is contained in:
parent
0870acd086
commit
65888c274a
20 changed files with 419 additions and 311 deletions
|
|
@ -69,9 +69,10 @@ router.delete('/', async (req, res) => {
|
|||
await processDeleteRequest({ req, files });
|
||||
|
||||
logger.debug(
|
||||
`[/files] Files deleted successfully: ${files.map(
|
||||
(f, i) => `${f.file_id}${i < files.length - 1 ? ', ' : ''}`,
|
||||
)}`,
|
||||
`[/files] Files deleted successfully: ${files
|
||||
.filter((f) => f.file_id)
|
||||
.map((f) => f.file_id)
|
||||
.join(', ')}`,
|
||||
);
|
||||
res.status(200).json({ message: 'Files deleted successfully' });
|
||||
} catch (error) {
|
||||
|
|
@ -220,7 +221,7 @@ router.post('/', async (req, res) => {
|
|||
try {
|
||||
await fs.unlink(file.path);
|
||||
} catch (error) {
|
||||
logger.error('[/files/images] Error deleting file after file processing:', error);
|
||||
logger.error('[/files] Error deleting file after file processing:', error);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue