4270-route.create #1023
|
@ -14,7 +14,7 @@ module.exports = Self => {
|
|||
},
|
||||
http: {
|
||||
path: `/:id/updateWorkCenter`,
|
||||
verb: 'GET'
|
||||
verb: 'POST'
|
||||
vicent marked this conversation as resolved
Outdated
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -34,7 +34,7 @@ module.exports = Self => {
|
|||
|
||||
try {
|
||||
const [result] = await Self.rawSql(`
|
||||
SELECT IFNULL(wl.workCenterFK, r.defaultWorkCenterFk) AS commissionWorkCenter
|
||||
SELECT IFNULL(wl.workCenterFk, r.defaultWorkCenterFk) AS commissionWorkCenter
|
||||
vicent marked this conversation as resolved
Outdated
carlosjr
commented
workCenterFK tiene la F y la K en mayus, esto parece un typo, miralo porfa. workCenterFK tiene la F y la K en mayus, esto parece un typo, miralo porfa.
|
||||
FROM vn.routeConfig r
|
||||
LEFT JOIN vn.workerLabour wl ON wl.workerFk = ?
|
||||
AND CURDATE() BETWEEN wl.started AND IFNULL(wl.ended, CURDATE());
|
||||
|
|
|
@ -5,8 +5,10 @@ export default class Controller extends Section {
|
|||
onSubmit() {
|
||||
this.$.watcher.submit().then(
|
||||
res => {
|
||||
this.$http.get(`Routes/${res.data.id}/updateWorkCenter`);
|
||||
this.$state.go('route.card.summary', {id: res.data.id});
|
||||
this.$http.post(`Routes/${res.data.id}/updateWorkCenter`, null)
|
||||
vicent marked this conversation as resolved
Outdated
carlosjr
commented
GET o POST? GET o POST?
|
||||
.then(() => {
|
||||
vicent marked this conversation as resolved
Outdated
carlosjr
commented
estas redirigiendo a una ruta antes de saber si ha resuelto correctamente el POST* de updateWorkCenter. esto es mala practica. estas redirigiendo a una ruta antes de saber si ha resuelto correctamente el POST* de updateWorkCenter.
esto es mala practica.
|
||||
this.$state.go('route.card.summary', {id: res.data.id});
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
GET o POST?