fixed eslint rules

This commit is contained in:
Joan Sanchez 2018-05-31 14:48:10 +02:00
parent 20897a287e
commit 4173180fde
8 changed files with 19 additions and 19 deletions

View File

@ -64,12 +64,13 @@ describe('Client', () => {
it('should define the classificationId property of the controller and then call the show method()', () => {
controller.$scope.closeContract = {show: () => {}};
spyOn(controller.$scope.closeContract, 'show');
expect(controller.classificationId).toBeFalsy();
controller.closeContract({id: 1});
expect(controller.classificationId).toEqual(1);
expect(controller.$scope.closeContract.show).toHaveBeenCalledWith();
});
});
});
});
});

View File

@ -33,20 +33,19 @@ class Controller {
}
]
};
let json = encodeURIComponent(JSON.stringify(filter));
let query = `/ticket/api/Tickets/${this.$state.params.id}?filter=${json}`;
this.$http.get(query).then(res => {
if (res.data)
this.ticket = res.data;
}
);
if (res.data)
this.ticket = res.data;
});
}
$onInit() {
this.getTicket();
}
reload() {
this.getTicket();
}

View File

@ -36,7 +36,7 @@ class Controller {
agencyModeFk: this.ticket.agencyModeFk,
warehouseFk: this.ticket.warehouseFk
};
return this.$http.post(query, data).then(res => {
if (res.data)
this.ticket.sale = res.data;

View File

@ -31,7 +31,7 @@ module.exports = Self => {
}
});
Self.send = async (recipient, data, ctx) => {
Self.send = async(recipient, data, ctx) => {
let query = `SELECT vn.messageSendWithUser(?, ?, ?) AS sent`;
let [result] = await Self.rawSql(query, [ctx.req.accessToken.userId, recipient, data.message]);

View File

@ -25,7 +25,7 @@ module.exports = Self => {
}
});
Self.priceDifference = async (ticketFk, data) => {
Self.priceDifference = async(ticketFk, data) => {
let filter = {
where: {
ticketFk: ticketFk

View File

@ -33,21 +33,21 @@ module.exports = Self => {
}
});
Self.componentUpdate = async (ticketFk, data, ctx) => {
Self.componentUpdate = async(ticketFk, data, ctx) => {
let userId = ctx.req.accessToken.userId;
let hasDeliveryRole = await Self.app.models.Account.hasRole(userId, 'delivery');
if (!hasDeliveryRole)
data.hasToBeUnrouted = true;
let query = 'CALL vn.ticketComponentMakeUpdate(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
let res = await Self.rawSql(query, [
ticketFk,
ticketFk,
data.clientFk,
data.agencyModeFk,
data.addressFk,
data.warehouseFk,
data.shipped,
data.agencyModeFk,
data.addressFk,
data.warehouseFk,
data.shipped,
data.landed,
data.isDeleted,
data.hasToBeUnrouted,

View File

@ -25,4 +25,4 @@ module.exports = Self => {
return taxes;
};
};
};

View File

@ -25,4 +25,4 @@ module.exports = Self => {
return total.amount ? total.amount : 0.00;
};
};
};