Skip to content

Commit

Permalink
refactor: moved transaction downwards
Browse files Browse the repository at this point in the history
  • Loading branch information
noctera committed Oct 10, 2021
1 parent 72ebd8b commit da25c89
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Services/ImportServiceProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ async function storeGroupVocabulary(
active,
activate
) {
const transaction = await sequelize.transaction();

const languagePackage = await LanguagePackage.findOne({
where: {
userId,
Expand All @@ -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(
{
Expand Down

0 comments on commit da25c89

Please sign in to comment.