diff --git a/src/controllers/v1/entityTypes.js b/src/controllers/v1/entityTypes.js index 5d5d2a8..2af8610 100644 --- a/src/controllers/v1/entityTypes.js +++ b/src/controllers/v1/entityTypes.js @@ -241,7 +241,7 @@ module.exports = class EntityTypes extends Abstract { const newEntityTypeData = await entityTypesHelper.bulkCreate(entityTypesCSVData, req.userDetails) // Check if entity types were created successfully - if (newEntityTypeData.length > 0) { + if (newEntityTypeData.length > 0 && newEntityTypeData[0].status === CONSTANTS.apiResponses.SUCCESS) { const fileName = `EntityType-Upload` let fileStream = new FileStream(fileName) let input = fileStream.initStream() @@ -263,7 +263,9 @@ module.exports = class EntityTypes extends Abstract { input.push(null) } else { - throw CONSTANTS.apiResponses.PROJECT_FAILED + const error = new Error(CONSTANTS.apiResponses.PROJECT_FAILED) + error.status = HTTP_STATUS_CODE.bad_request.status + throw error } } catch (error) { return reject({ diff --git a/src/module/entities/helper.js b/src/module/entities/helper.js index 6894c24..dc8f91e 100644 --- a/src/module/entities/helper.js +++ b/src/module/entities/helper.js @@ -564,7 +564,7 @@ module.exports = class UserProjectsHelper { new: true, } ) - await this.mappedParentEntities(updatedParentEntity, childEntity) + // await this.mappedParentEntities(updatedParentEntity, childEntity) } return resolve()