fix: refs #7906 remake method
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
5a2058865d
commit
46e657675b
|
@ -240,5 +240,6 @@
|
||||||
"There is already a tray with the same height": "There is already a tray with the same height",
|
"There is already a tray with the same height": "There is already a tray with the same height",
|
||||||
"The height must be greater than 50cm": "The height must be greater than 50cm",
|
"The height must be greater than 50cm": "The height must be greater than 50cm",
|
||||||
"The maximum height of the wagon is 200cm": "The maximum height of the wagon is 200cm",
|
"The maximum height of the wagon is 200cm": "The maximum height of the wagon is 200cm",
|
||||||
"The quantity claimed cannot be greater than the quantity of the line": "The quantity claimed cannot be greater than the quantity of the line"
|
"The quantity claimed cannot be greater than the quantity of the line": "The quantity claimed cannot be greater than the quantity of the line",
|
||||||
|
"There are tickets for this area, delete them first": "There are tickets for this area, delete them first"
|
||||||
}
|
}
|
||||||
|
|
|
@ -382,5 +382,6 @@
|
||||||
"This buyer has already made a reservation for this date": "Este comprador ya ha hecho una reserva para esta fecha",
|
"This buyer has already made a reservation for this date": "Este comprador ya ha hecho una reserva para esta fecha",
|
||||||
"No valid travel thermograph found": "No se encontró un termógrafo válido",
|
"No valid travel thermograph found": "No se encontró un termógrafo válido",
|
||||||
"The quantity claimed cannot be greater than the quantity of the line": "La cantidad reclamada no puede ser mayor que la cantidad de la línea",
|
"The quantity claimed cannot be greater than the quantity of the line": "La cantidad reclamada no puede ser mayor que la cantidad de la línea",
|
||||||
"type cannot be blank": "Se debe rellenar el tipo"
|
"type cannot be blank": "Se debe rellenar el tipo",
|
||||||
}
|
"There are tickets for this area, delete them first": "Hay tickets para esta sección, borralos primero"
|
||||||
|
}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
const UserError = require('vn-loopback/util/user-error');
|
||||||
module.exports = Self => {
|
module.exports = Self => {
|
||||||
Self.remoteMethodCtx('deleteZone', {
|
Self.remoteMethodCtx('deleteZone', {
|
||||||
description: 'Delete a zone',
|
description: 'Delete a zone',
|
||||||
|
@ -57,7 +58,8 @@ module.exports = Self => {
|
||||||
where: {id: userId}
|
where: {id: userId}
|
||||||
}, myOptions);
|
}, myOptions);
|
||||||
|
|
||||||
await models.Ticket.rawSql('UPDATE ticket SET zoneFk = NULL WHERE zoneFk = ?', [id], myOptions);
|
if (ticketList.length > 0)
|
||||||
|
throw new UserError('There are tickets for this area, delete them first');
|
||||||
|
|
||||||
for (ticket of ticketList) {
|
for (ticket of ticketList) {
|
||||||
if (ticket.ticketState().alertLevel == 0) {
|
if (ticket.ticketState().alertLevel == 0) {
|
||||||
|
|
Loading…
Reference in New Issue