fix: refs #6398 Changed alias of views
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
David Domenech 2023-12-19 09:43:09 +01:00
parent 6ff7edfada
commit d60f2a7f88
4 changed files with 12 additions and 12 deletions

View File

@ -3,7 +3,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost`
VIEW `vn`.`ticketState`
AS SELECT `tt`.`created` AS `updated`,
`tt`.`stateFk` AS `stateFk`,
`tt`.`userFk` AS `userFk`,
`tt`.`userFk` AS `workerFk`,
`tls`.`ticketFk` AS `ticketFk`,
`s`.`id` AS `state`,
`s`.`order` AS `productionOrder`,
@ -40,7 +40,7 @@ SELECT
`ts`.`state` AS `state`,
`ts`.`productionOrder` AS `productionOrder`,
`ts`.`alertLevel` AS `alertLevel`,
`ts`.`userFk` AS `userFk`,
`ts`.`userFk` AS `worker`,
`ts`.`code` AS `code`,
`ts`.`updated` AS `updated`,
`ts`.`isPicked` AS `isPicked`

View File

@ -51,12 +51,12 @@ module.exports = Self => {
params.stateFk = state.id;
}
if (!params.userFk) {
if (!params.workerFk) {
const worker = await models.Worker.findOne({
where: {id: userId}
}, myOptions);
params.userFk = worker.id;
params.workerFk = worker.id;
}
const ticketState = await models.TicketState.findById(params.ticketFk, {

View File

@ -36,7 +36,7 @@
"user": {
"type": "belongsTo",
"model": "VnUser",
"foreignKey": "userFk"
"foreignKey": "workerFk"
}
}
}