4270-route.create #1023

Merged
joan merged 13 commits from 4270-route.create into dev 2022-08-03 07:09:11 +00:00
2 changed files with 6 additions and 4 deletions
Showing only changes of commit 318b688b67 - Show all commits

View File

@ -14,7 +14,7 @@ module.exports = Self => {
},
http: {
path: `/:id/updateWorkCenter`,
verb: 'GET'
verb: 'POST'
vicent marked this conversation as resolved Outdated

GET o POST?

GET o POST?
}
});
@ -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

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());

View File

@ -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

GET o POST?

GET o POST?
.then(() => {
vicent marked this conversation as resolved Outdated

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});
});
}
);
}