feat: enhance JWT authentication and quick import functionality with logging for better traceability
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -15,6 +15,19 @@ export class QuickImportController {
|
||||
FileInterceptor('file', {
|
||||
storage: memoryStorage(),
|
||||
limits: { fileSize: 10 * 1024 * 1024 },
|
||||
fileFilter: (req, file, callback) => {
|
||||
if (
|
||||
file.mimetype === 'application/pdf' ||
|
||||
file.mimetype === 'application/octet-stream' ||
|
||||
file.mimetype === 'image/jpeg' ||
|
||||
file.mimetype === 'image/png' ||
|
||||
file.mimetype === 'image/webp'
|
||||
) {
|
||||
callback(null, true);
|
||||
} else {
|
||||
callback(new Error('Otillåten filtyp. Använd JPEG, PNG, WebP eller PDF.'), false);
|
||||
}
|
||||
},
|
||||
}),
|
||||
)
|
||||
async importFromInput(
|
||||
|
||||
Reference in New Issue
Block a user