From e45ac6424c10815a96f6ac115d871a012cd1e21b Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Fri, 14 Jun 2024 11:43:06 +0200 Subject: [PATCH] perf(salix): refs #6321 #6321 updates --- modules/ticket/back/methods/sale/replaceItem.js | 4 ++-- modules/ticket/back/methods/ticket/itemLackDetail.js | 1 + modules/ticket/back/methods/ticket/specs/itemLack.spec.js | 2 +- modules/ticket/back/methods/ticket/split.js | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/ticket/back/methods/sale/replaceItem.js b/modules/ticket/back/methods/sale/replaceItem.js index 529d429eb..c153ee5d2 100644 --- a/modules/ticket/back/methods/sale/replaceItem.js +++ b/modules/ticket/back/methods/sale/replaceItem.js @@ -25,12 +25,12 @@ module.exports = Self => { root: true }, http: { - path: `/recalculatePrice`, + path: `/replaceItem`, verb: 'POST' } }); - Self.recalculatePrice = async(ctx, saleFk, itemFk, quantity, options) => { + Self.replaceItem = async(ctx, saleFk, itemFk, quantity, options) => { const myOptions = {userId: ctx.req.accessToken.userId}; let tx; diff --git a/modules/ticket/back/methods/ticket/itemLackDetail.js b/modules/ticket/back/methods/ticket/itemLackDetail.js index 9c9ffd010..33beec505 100644 --- a/modules/ticket/back/methods/ticket/itemLackDetail.js +++ b/modules/ticket/back/methods/ticket/itemLackDetail.js @@ -47,6 +47,7 @@ module.exports = Self => { s.itemFk itemFk, s.price price, al.code alertLevelCode, + z.id zoneFk, z.name zoneName, z.hour theoreticalhour, cn.isRookie, diff --git a/modules/ticket/back/methods/ticket/specs/itemLack.spec.js b/modules/ticket/back/methods/ticket/specs/itemLack.spec.js index 4d654d830..4ca82b24d 100644 --- a/modules/ticket/back/methods/ticket/specs/itemLack.spec.js +++ b/modules/ticket/back/methods/ticket/specs/itemLack.spec.js @@ -1,6 +1,6 @@ const models = require('vn-loopback/server/server').models; -fdescribe('Item Lack', () => { +describe('Item Lack', () => { beforeEach(async() => { ctx = { req: { diff --git a/modules/ticket/back/methods/ticket/split.js b/modules/ticket/back/methods/ticket/split.js index cd821c019..83a4e8b0c 100644 --- a/modules/ticket/back/methods/ticket/split.js +++ b/modules/ticket/back/methods/ticket/split.js @@ -36,7 +36,8 @@ module.exports = Self => { try { const ticketsIds = tickets.map(({ticketFk}, index) => ticketFk); const ticketsCount = await Self.rawSql(` - Select t.id tid, s.id sid, count(s.id) count from + Select t.id tid, s.id sid, count(s.id) count + FROM vn.ticket t LEFT JOIN vn.sale s ON s.ticketFk = t.id