perf: refs #6321 remove comments
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
2574e59c71
commit
767c891317
|
@ -1,14 +1,16 @@
|
|||
module.exports = Self => {
|
||||
Self.remoteMethodCtx('getSimilar', {
|
||||
description: 'Returns the ',
|
||||
description: 'Returns list of items with similar item requested',
|
||||
accessType: 'READ',
|
||||
accepts: [{
|
||||
arg: 'filter',
|
||||
type: 'Object',
|
||||
required: true,
|
||||
description: 'Filter defining where and paginated data',
|
||||
http: {source: 'query'}
|
||||
}],
|
||||
accepts: [
|
||||
{
|
||||
arg: 'filter',
|
||||
type: 'Object',
|
||||
required: true,
|
||||
description: 'Filter defining where and paginated data',
|
||||
http: {source: 'query'}
|
||||
}
|
||||
],
|
||||
returns: {
|
||||
type: ['Object'],
|
||||
root: true
|
||||
|
|
|
@ -73,7 +73,7 @@ module.exports = Self => {
|
|||
query: [sale.ticketFk]
|
||||
};
|
||||
const salesPerson = await Self.rawSql(salesPersonQuery.sql, salesPersonQuery.query, myOptions);
|
||||
const url = await Self.app.models.Url.getUrl();
|
||||
const url = await models.Url.getUrl();
|
||||
const substitution = await models.Item.findById(substitutionFk, {
|
||||
fields: ['id', 'name', 'longName']
|
||||
}, myOptions);
|
||||
|
|
|
@ -146,8 +146,7 @@ module.exports = Self => {
|
|||
stmt.merge({
|
||||
sql: `AND ts.alertLevel=?`, params: [filter.where.stateFk]});
|
||||
}
|
||||
// }
|
||||
// stmt.merge(conn.makeWhere(filter.where));
|
||||
|
||||
const sql = ParameterizedSQL.join([stmt], ';');
|
||||
const result = await conn.executeStmt(sql, myOptions);
|
||||
return result;
|
||||
|
|
|
@ -62,24 +62,6 @@ describe('Item Lack', () => {
|
|||
}
|
||||
});
|
||||
|
||||
// it('should return data with filter.name', async() => {
|
||||
// const tx = await models.Ticket.beginTransaction({});
|
||||
|
||||
// const options = {transaction: tx};
|
||||
// const filter = {
|
||||
// name: 1
|
||||
// };
|
||||
// try {
|
||||
// const result = await models.Ticket.itemLack(ctx, filter, options);
|
||||
|
||||
// expect(result.length).toEqual(1);
|
||||
// await tx.rollback();
|
||||
// } catch (e) {
|
||||
// await tx.rollback();
|
||||
// throw e;
|
||||
// }
|
||||
// });
|
||||
|
||||
it('should return data with filter.color', async() => {
|
||||
const tx = await models.Ticket.beginTransaction({});
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@ module.exports = Self => {
|
|||
}
|
||||
|
||||
try {
|
||||
// const ticketsIds = ticket.map(({ticketFk}, index) => ticketFk);
|
||||
const ticketsCount = await Self.rawSql(`
|
||||
Select t.id tid, s.id sid, count(s.id) count
|
||||
FROM
|
||||
|
@ -56,6 +55,7 @@ module.exports = Self => {
|
|||
result.push({ticket: tid, status: 'noSplit'});
|
||||
continue;
|
||||
}
|
||||
|
||||
const [, [{vNewTicket}]] = await Self.rawSql(`
|
||||
CALL vn.ticket_clone(?, @vNewTicket);
|
||||
SELECT @vNewTicket vNewTicket;`,
|
||||
|
@ -69,6 +69,7 @@ module.exports = Self => {
|
|||
const updateIsPicked = sales.map(({sid}) => Self.rawSql(`
|
||||
UPDATE vn.sale SET isPicked = (id = ?) WHERE ticketFk = ?`,
|
||||
[sid, tid], myOptions));
|
||||
|
||||
await Promise.all(updateIsPicked);
|
||||
await Self.transferSales(ctx, tid, vNewTicket, sales, myOptions);
|
||||
|
||||
|
|
Loading…
Reference in New Issue