try
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Alex Moreno 2023-05-19 08:34:51 +02:00
parent 08ac3ab0a1
commit dd16633b53
2 changed files with 6 additions and 4 deletions

View File

@ -25,7 +25,7 @@ describe('zone toggleIsIncluded()', () => {
try {
const options = {transaction: tx};
log('Zone.toggleIsIncluded start');
let result = models.Zone.toggleIsIncluded(1, 20, true, options);
let result = await models.Zone.toggleIsIncluded(1, 20, true, options);
log('Zone.toggleIsIncluded finish');
expect(result.isIncluded).toBeTrue();

View File

@ -35,17 +35,19 @@ module.exports = Self => {
const models = Self.app.models;
const myOptions = {};
if (typeof options == 'object')
if (typeof options == 'object') {
log(`Don't use new transacction`);
Object.assign(myOptions, options);
}
let data;
if (isIncluded === undefined) {
log('Zone.toggleIsIncluded destroyAll start');
data = models.ZoneIncluded.destroyAll({zoneFk: id, geoFk: geoId}, myOptions);
data = await models.ZoneIncluded.destroyAll({zoneFk: id, geoFk: geoId}, myOptions);
} else {
log('Zone.toggleIsIncluded upsert start');
data = models.ZoneIncluded.upsert({
data = await models.ZoneIncluded.upsert({
zoneFk: id,
geoFk: geoId,
isIncluded: isIncluded