diff --git a/src/services/initialization.service.ts b/src/services/initialization.service.ts index 37296f77e4b7ebd4d0a78371450eca2e5aa621b8..ec3330a2d8591174b247b2e0353997d647a58f43 100644 --- a/src/services/initialization.service.ts +++ b/src/services/initialization.service.ts @@ -188,11 +188,9 @@ export default class InitializationService { ) { // Populate the doctype with data try { - await Promise.all( - ecogestureData.map(async ecogesture => { - await this._client.create(ECOGESTURE_DOCTYPE, ecogesture) - }) - ) + for (let i = 0; i <= ecogestureData.length - 1; i++) { + await this._client.create(ECOGESTURE_DOCTYPE, ecogestureData[i]) + } // Check of created document based on count const checkCount = await ecogestureService.getAllEcogestures() if ( @@ -266,11 +264,10 @@ export default class InitializationService { ) { // Populate the doctype with data try { - await Promise.all( - challengeEntityData.map(async challengeEntity => { - await this._client.create(CHALLENGE_DOCTYPE, challengeEntity) - }) - ) + for (let i = 0; i <= challengeEntityData.length - 1; i++) { + await this._client.create(CHALLENGE_DOCTYPE, challengeEntityData[i]) + } + // Check of created document const checkCount = await challengeService.getAllChallengeEntities() if ( @@ -340,11 +337,9 @@ export default class InitializationService { if (!loadedDuelTypes || (loadedDuelTypes && loadedDuelTypes.length === 0)) { // Populate the doctype with data try { - await Promise.all( - duelEntityData.map(async duelEntity => { - await this._client.create(DUEL_DOCTYPE, duelEntity) - }) - ) + for (let i = 0; i <= duelEntityData.length - 1; i++) { + await this._client.create(DUEL_DOCTYPE, duelEntityData[i]) + } // Check of created document const checkCount = await duelService.getAllDuelEntities() if ( @@ -417,11 +412,9 @@ export default class InitializationService { ) { // Populate the doctype with data try { - await Promise.all( - quizEntityData.map(async quizEntity => { - await this._client.create(QUIZ_DOCTYPE, quizEntity) - }) - ) + for (let i = 0; i <= quizEntityData.length - 1; i++) { + await this._client.create(QUIZ_DOCTYPE, quizEntityData[i]) + } // Check of created document const checkCount = await quizService.getAllQuizEntities() if (