Skip to content
Merged
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
11 changes: 6 additions & 5 deletions src/services/tenant.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,10 @@ module.exports = class tenantHelper {
})

if (fetchAllDefaultOrgFeatures.length > 0) {
const orgFeatureCreationPromise = fetchAllDefaultOrgFeatures.map((feature) => {
return organizationFetureService.create(
const orgFeatureCreateResponse = []

for (const feature of fetchAllDefaultOrgFeatures) {
const response = await organizationFetureService.create(
{
feature_code: feature.feature_code,
enabled: feature.enabled,
Expand All @@ -324,9 +326,8 @@ module.exports = class tenantHelper {
id: userId,
}
)
})
const orgFeatureCreateResponse = await Promise.all(orgFeatureCreationPromise)

orgFeatureCreateResponse.push(response)
}
orgFeatureCreateResponse.map((feature) => {
rollbackStack.push(async () => {
await organizationFeatureQueries.hardDelete(
Expand Down