Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/controllers/v1/entityTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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({
Expand Down
2 changes: 1 addition & 1 deletion src/module/entities/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ module.exports = class UserProjectsHelper {
new: true,
}
)
await this.mappedParentEntities(updatedParentEntity, childEntity)
// await this.mappedParentEntities(updatedParentEntity, childEntity)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MallanagoudaB Please explain why this is commented

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was mapping to all the entities.
Example: if we map to karnataka a school it was mapping to all other entities (Assam, Tamil Nadu)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MallanagoudaB if you comment this how the karanataka school mapping work?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it has been done already in previous code i verified that.

}

return resolve()
Expand Down