try
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
e4496cf062
commit
20c308d228
|
@ -25,11 +25,13 @@ describe('zone toggleIsIncluded()', () => {
|
|||
const options = {transaction: tx};
|
||||
console.log('Zone.toggleIsIncluded start');
|
||||
let result = await models.Zone.toggleIsIncluded(1, 20, true, options);
|
||||
console.log('Zone.toggleIsIncluded ready');
|
||||
console.log('Zone.toggleIsIncluded finish');
|
||||
|
||||
expect(result.isIncluded).toBeTrue();
|
||||
|
||||
console.log('rollback start');
|
||||
await tx.rollback();
|
||||
console.log('rollback finish');
|
||||
} catch (e) {
|
||||
await tx.rollback();
|
||||
throw e;
|
||||
|
|
|
@ -36,15 +36,20 @@ module.exports = Self => {
|
|||
if (typeof options == 'object')
|
||||
Object.assign(myOptions, options);
|
||||
|
||||
let data;
|
||||
if (isIncluded === undefined) {
|
||||
console.log('Zone.toggleIsIncluded destroyAll start');
|
||||
return models.ZoneIncluded.destroyAll({zoneFk: id, geoFk: geoId}, myOptions);
|
||||
data = models.ZoneIncluded.destroyAll({zoneFk: id, geoFk: geoId}, myOptions);
|
||||
} else {
|
||||
return models.ZoneIncluded.upsert({
|
||||
console.log('Zone.toggleIsIncluded upsert start');
|
||||
|
||||
data = models.ZoneIncluded.upsert({
|
||||
zoneFk: id,
|
||||
geoFk: geoId,
|
||||
isIncluded: isIncluded
|
||||
}, myOptions);
|
||||
}
|
||||
console.log('Zone.toggleIsIncluded return');
|
||||
return data;
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue