Fix TypeScript error for officeparser
This commit is contained in:
@@ -39,7 +39,7 @@ export const uploadDocument = async (req: AuthenticatedRequest, res: Response) =
|
|||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
// officeParser natively supports pdf, docx, doc, rtf, txt, etc.
|
// officeParser natively supports pdf, docx, doc, rtf, txt, etc.
|
||||||
extractedText = await officeParser.parseOffice(file.buffer);
|
extractedText = (await officeParser.parseOffice(file.buffer)) as unknown as string;
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
console.error('officeParser Error:', err);
|
console.error('officeParser Error:', err);
|
||||||
return res.status(400).json({ error: 'Dosya formatı okunamadı veya desteklenmiyor.' });
|
return res.status(400).json({ error: 'Dosya formatı okunamadı veya desteklenmiyor.' });
|
||||||
|
|||||||
Reference in New Issue
Block a user