diff --git a/app/Services/ImportServiceProvider.js b/app/Services/ImportServiceProvider.js index f3af5f7e..0849c6af 100644 --- a/app/Services/ImportServiceProvider.js +++ b/app/Services/ImportServiceProvider.js @@ -12,8 +12,6 @@ async function storeGroupVocabulary( active, activate ) { - const transaction = await sequelize.transaction(); - const languagePackage = await LanguagePackage.findOne({ where: { userId, @@ -25,6 +23,8 @@ async function storeGroupVocabulary( throw new ApiError(httpStatus.NOT_FOUND, 'language package not found'); } + const transaction = await sequelize.transaction(); + try { const group = await Group.create( {