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()', () => {
|
it('should define the classificationId property of the controller and then call the show method()', () => {
|
||||||
controller.$scope.closeContract = {show: () => {}};
|
controller.$scope.closeContract = {show: () => {}};
|
||||||
spyOn(controller.$scope.closeContract, 'show');
|
spyOn(controller.$scope.closeContract, 'show');
|
||||||
|
|
||||||
expect(controller.classificationId).toBeFalsy();
|
expect(controller.classificationId).toBeFalsy();
|
||||||
controller.closeContract({id: 1});
|
controller.closeContract({id: 1});
|
||||||
|
|
||||||
expect(controller.classificationId).toEqual(1);
|
expect(controller.classificationId).toEqual(1);
|
||||||
expect(controller.$scope.closeContract.show).toHaveBeenCalledWith();
|
expect(controller.$scope.closeContract.show).toHaveBeenCalledWith();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -33,20 +33,19 @@ class Controller {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
let json = encodeURIComponent(JSON.stringify(filter));
|
let json = encodeURIComponent(JSON.stringify(filter));
|
||||||
let query = `/ticket/api/Tickets/${this.$state.params.id}?filter=${json}`;
|
let query = `/ticket/api/Tickets/${this.$state.params.id}?filter=${json}`;
|
||||||
this.$http.get(query).then(res => {
|
this.$http.get(query).then(res => {
|
||||||
if (res.data)
|
if (res.data)
|
||||||
this.ticket = res.data;
|
this.ticket = res.data;
|
||||||
}
|
});
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$onInit() {
|
$onInit() {
|
||||||
this.getTicket();
|
this.getTicket();
|
||||||
}
|
}
|
||||||
|
|
||||||
reload() {
|
reload() {
|
||||||
this.getTicket();
|
this.getTicket();
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ class Controller {
|
||||||
agencyModeFk: this.ticket.agencyModeFk,
|
agencyModeFk: this.ticket.agencyModeFk,
|
||||||
warehouseFk: this.ticket.warehouseFk
|
warehouseFk: this.ticket.warehouseFk
|
||||||
};
|
};
|
||||||
|
|
||||||
return this.$http.post(query, data).then(res => {
|
return this.$http.post(query, data).then(res => {
|
||||||
if (res.data)
|
if (res.data)
|
||||||
this.ticket.sale = 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 query = `SELECT vn.messageSendWithUser(?, ?, ?) AS sent`;
|
||||||
let [result] = await Self.rawSql(query, [ctx.req.accessToken.userId, recipient, data.message]);
|
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 = {
|
let filter = {
|
||||||
where: {
|
where: {
|
||||||
ticketFk: ticketFk
|
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 userId = ctx.req.accessToken.userId;
|
||||||
let hasDeliveryRole = await Self.app.models.Account.hasRole(userId, 'delivery');
|
let hasDeliveryRole = await Self.app.models.Account.hasRole(userId, 'delivery');
|
||||||
|
|
||||||
if (!hasDeliveryRole)
|
if (!hasDeliveryRole)
|
||||||
data.hasToBeUnrouted = true;
|
data.hasToBeUnrouted = true;
|
||||||
|
|
||||||
let query = 'CALL vn.ticketComponentMakeUpdate(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
|
let query = 'CALL vn.ticketComponentMakeUpdate(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
|
||||||
let res = await Self.rawSql(query, [
|
let res = await Self.rawSql(query, [
|
||||||
ticketFk,
|
ticketFk,
|
||||||
data.clientFk,
|
data.clientFk,
|
||||||
data.agencyModeFk,
|
data.agencyModeFk,
|
||||||
data.addressFk,
|
data.addressFk,
|
||||||
data.warehouseFk,
|
data.warehouseFk,
|
||||||
data.shipped,
|
data.shipped,
|
||||||
data.landed,
|
data.landed,
|
||||||
data.isDeleted,
|
data.isDeleted,
|
||||||
data.hasToBeUnrouted,
|
data.hasToBeUnrouted,
|
||||||
|
|
|
@ -25,4 +25,4 @@ module.exports = Self => {
|
||||||
|
|
||||||
return taxes;
|
return taxes;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -25,4 +25,4 @@ module.exports = Self => {
|
||||||
|
|
||||||
return total.amount ? total.amount : 0.00;
|
return total.amount ? total.amount : 0.00;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue