From 3d32b33c4922e8e959a4a46dd3acfb973c51dce8 Mon Sep 17 00:00:00 2001 From: MallanagoudaB Date: Thu, 17 Oct 2024 17:27:05 +0530 Subject: [PATCH 1/2] "resolved-1971-1976" --- src/controllers/v1/entityTypes.js | 6 ++++-- src/module/entities/helper.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/controllers/v1/entityTypes.js b/src/controllers/v1/entityTypes.js index 5d5d2a8..a76d31c 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 === '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() From 790c0f35d8386e91fb0999801f029977db5cf458 Mon Sep 17 00:00:00 2001 From: MallanagoudaB Date: Mon, 21 Oct 2024 09:36:43 +0530 Subject: [PATCH 2/2] "added-Success" --- src/controllers/v1/entityTypes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/v1/entityTypes.js b/src/controllers/v1/entityTypes.js index a76d31c..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 && newEntityTypeData[0].status === 'SUCCESS') { + if (newEntityTypeData.length > 0 && newEntityTypeData[0].status === CONSTANTS.apiResponses.SUCCESS) { const fileName = `EntityType-Upload` let fileStream = new FileStream(fileName) let input = fileStream.initStream()