diff --git a/services/loopback/common/models/vn-model.js b/services/loopback/common/models/vn-model.js index 3fb16a57f..17444a7aa 100644 --- a/services/loopback/common/models/vn-model.js +++ b/services/loopback/common/models/vn-model.js @@ -57,12 +57,13 @@ module.exports = function(Self) { promises.push(this.upsertWithWhere(update.where, update.data, options)); await Promise.all(promises); } - if (creates && creates.length) + if (creates && creates.length) { try { await this.create(creates, options); } catch (error) { throw error[error.length - 1]; } + } await transaction.commit(); } catch (error) {