Fixing the error when importing a large Excel file

This commit is contained in:
2026-10-03 15:01:01 +03:30
parent f8313c0ea5
commit 2e315c9cfd
15 changed files with 503 additions and 86 deletions
+9 -2
View File
@@ -82,11 +82,18 @@ export class PeopleController {
@CurrentUser() user: Actor,
@UploadedFile() file?: Express.Multer.File,
@Body('mapping') mapping?: string,
@Body('sessionId') sessionId?: string,
@Body('offset') offset?: string,
@Body('limit') limit?: string,
) {
if (!file?.buffer?.length) {
if (!file?.buffer?.length && !sessionId) {
throw new BadRequestException('فایل ارسال نشده');
}
return this.excelService.importPeople(user, file, mapping);
return this.excelService.importPeople(user, file, mapping, {
sessionId,
offset,
limit,
});
}
@Get(':id')