add empty array check on import resources

This commit is contained in:
Akshay Sasidharan 2024-06-13 22:29:11 +05:30
parent 37364c12d8
commit 67bbce4070

View file

@ -54,13 +54,13 @@ export class ImportExportResourcesService {
const imports = { app: [], tooljet_database: [] };
const importingVersion = importResourcesDto.tooljet_version;
if (importResourcesDto.tooljet_database) {
if (!isEmpty(importResourcesDto.tooljet_database)) {
const res = await this.tooljetDbImportExportService.bulkImport(importResourcesDto, importingVersion, cloning);
tableNameMapping = res.tableNameMapping;
imports.tooljet_database = res.tooljet_database;
}
if (importResourcesDto.app) {
if (!isEmpty(importResourcesDto.app)) {
for (const appImportDto of importResourcesDto.app) {
user.organizationId = importResourcesDto.organization_id;
const createdApp = await this.appImportExportService.import(