fixed eslint rules
This commit is contained in:
parent
20897a287e
commit
4173180fde
|
@ -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();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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]);
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ module.exports = Self => {
|
|||
}
|
||||
});
|
||||
|
||||
Self.priceDifference = async (ticketFk, data) => {
|
||||
Self.priceDifference = async(ticketFk, data) => {
|
||||
let filter = {
|
||||
where: {
|
||||
ticketFk: ticketFk
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -25,4 +25,4 @@ module.exports = Self => {
|
|||
|
||||
return taxes;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -25,4 +25,4 @@ module.exports = Self => {
|
|||
|
||||
return total.amount ? total.amount : 0.00;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue