4270-route.create #1023
Labels
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: verdnatura/salix#1023
Loading…
Reference in New Issue
No description provided.
Delete Branch "4270-route.create"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -0,0 +4,4 @@
const routeId = 1;
it('should set the commission work center if the worker has workCenter', async() => {
const tx = await models.Defaulter.beginTransaction({});
Es confuso iniciar la transacción en un modelo que no es el que vas a invocar en tu funcionalidad.
models.Defaulter vs models.Route
@ -0,0 +26,4 @@
}
});
it(`should set the commission work center equals default work center if the worker hasn't workCenter`, async() => {
Shoul set the default commision work center if that worker didn't have one yet
@ -0,0 +29,4 @@
it(`should set the commission work center equals default work center if the worker hasn't workCenter`, async() => {
const tx = await models.Defaulter.beginTransaction({});
try {
const noExistentId = 2;
¿Te refieres a el user "Customer" no tiene workCenter asignado? esta variable es confusa, dale un nombre que describa realmente lo que hace.
@ -0,0 +14,4 @@
},
http: {
path: `/:id/updateWorkCenter`,
verb: 'GET'
GET o POST?
@ -0,0 +34,4 @@
try {
const [result] = await Self.rawSql(`
SELECT IFNULL(wl.workCenterFK, r.defaultWorkCenterFk) AS commissionWorkCenter
workCenterFK tiene la F y la K en mayus, esto parece un typo, miralo porfa.
@ -6,2 +6,3 @@
this.$.watcher.submit().then(
res => this.$state.go('route.card.summary', {id: res.data.id})
res => {
this.$http.get(`Routes/${res.data.id}/updateWorkCenter`);
GET o POST?
@ -7,1 +7,3 @@
res => this.$state.go('route.card.summary', {id: res.data.id})
res => {
this.$http.get(`Routes/${res.data.id}/updateWorkCenter`);
this.$state.go('route.card.summary', {id: res.data.id});
estas redirigiendo a una ruta antes de saber si ha resuelto correctamente el POST* de updateWorkCenter.
esto es mala practica.
LGTM