edits for trenders attachments & claims

This commit is contained in:
Aya
2026-05-19 11:41:44 +03:00
parent 7732a40726
commit 12c4ca8334
19 changed files with 583 additions and 105 deletions

View File

@@ -250,8 +250,12 @@ export class TendersController {
const fs = require('fs')
if (!fs.existsSync(file)) {
console.error('[tenders.viewAttachment] Resolved path missing at send time', {
attachmentId: req.params.attachmentId,
resolvedPath: file,
})
return res.status(404).json(
ResponseFormatter.error('File not found', 'الملف غير موجود')
ResponseFormatter.error('File not found - الملف غير موجود', 'FILE_NOT_FOUND')
)
}
@@ -259,7 +263,7 @@ export class TendersController {
return res.sendFile(path.resolve(file))
} catch (error) {
console.error(error)
console.error('[tenders.viewAttachment]', error)
next(error)
}
}