refactor: change type of params in endpoints
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
b886a7e0da
commit
4076f2908e
|
@ -17,7 +17,7 @@ module.exports = Self => {
|
|||
},
|
||||
{
|
||||
arg: 'geoIds',
|
||||
type: 'any',
|
||||
type: ['number'],
|
||||
description: 'The geos id'
|
||||
}
|
||||
|
||||
|
@ -48,10 +48,10 @@ module.exports = Self => {
|
|||
|
||||
const promises = [];
|
||||
|
||||
for (let geoId of geoIds) {
|
||||
for (const geoId of geoIds) {
|
||||
const newZoneExclusionGeo = await models.ZoneExclusionGeo.create({
|
||||
zoneExclusionFk: newZoneExclusion.id,
|
||||
geoFk: geoId.id
|
||||
geoFk: geoId
|
||||
}, myOptions);
|
||||
|
||||
promises.push(newZoneExclusionGeo);
|
||||
|
|
|
@ -27,7 +27,7 @@ describe('zone exclusionGeo()', () => {
|
|||
|
||||
try {
|
||||
const options = {transaction: tx};
|
||||
const geoIds = [{id: 1}, {id: 2}];
|
||||
const geoIds = [1, 2];
|
||||
const result = await models.Zone.exclusionGeo(zoneId, today, geoIds, options);
|
||||
|
||||
expect(result.length).toEqual(2);
|
||||
|
|
|
@ -26,7 +26,7 @@ describe('zone updateExclusionGeo()', () => {
|
|||
try {
|
||||
const options = {transaction: tx};
|
||||
const zoneId = 2;
|
||||
const geoIds = [{id: 1}, {id: 2}];
|
||||
const geoIds = [1, 2];
|
||||
const result = await models.Zone.updateExclusionGeo(zoneId, geoIds, options);
|
||||
|
||||
expect(result.length).toEqual(2);
|
||||
|
|
|
@ -11,7 +11,7 @@ module.exports = Self => {
|
|||
},
|
||||
{
|
||||
arg: 'geoIds',
|
||||
type: 'any',
|
||||
type: ['number'],
|
||||
description: 'The geos id'
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ module.exports = Self => {
|
|||
for (const geoId of geoIds) {
|
||||
const params = {
|
||||
zoneExclusionFk: zoneExclusionFk,
|
||||
geoFk: geoId.id
|
||||
geoFk: geoId
|
||||
};
|
||||
const deletedZoneExclusionGeos = models.ZoneExclusionGeo.create(params, myOptions);
|
||||
promises.push(deletedZoneExclusionGeos);
|
||||
|
|
|
@ -215,7 +215,7 @@ class Controller extends Section {
|
|||
const excludeSelected = this.excludeSelected;
|
||||
let req;
|
||||
const geoIds = [];
|
||||
this.exclusionGeos.forEach(id => geoIds.push({id}));
|
||||
this.exclusionGeos.forEach(id => geoIds.push(id));
|
||||
|
||||
if (this.isNew) {
|
||||
const params = {
|
||||
|
|
Loading…
Reference in New Issue