deprecated changeWorker as it is no longer in use

This commit is contained in:
Carlos Jimenez Ruiz 2021-08-12 11:06:49 +02:00
parent 2c3f46f394
commit 708c0035c0
2 changed files with 0 additions and 48 deletions

View File

@ -1,47 +0,0 @@
module.exports = function(Self) {
Self.remoteMethodCtx('changeWorker', {
description: 'Change worker of tickets state',
accepts: [
{
arg: 'worker',
type: 'number',
required: true,
description: 'worker id',
http: {source: 'path'}
}
],
returns: {
arg: 'response',
type: 'boolean'
},
http: {
verb: 'put',
path: '/:worker/changeWorker'
}
});
Self.changeWorker = function(ctx, worker, cb) {
let tickets = ctx.req.body.tickets;
changeWorker(worker, tickets, cb);
};
function changeWorker(worker, tickets, cb) {
let ticketTracking = Self.app.models.ticketTracking;
let toSave = [];
for (let ticket of tickets) {
toSave.push(
{
stateFk: 20,
ticketFk: ticket,
workerFk: worker
}
);
}
ticketTracking.create(toSave, function(err, info) {
if (err)
cb(err, null);
else
cb(null, info);
});
}
};

View File

@ -2,7 +2,6 @@
const LoopBackContext = require('loopback-context');
module.exports = Self => {
require('../methods/ticket/changeWorker')(Self);
require('../methods/ticket/getVolume')(Self);
require('../methods/ticket/getTotalVolume')(Self);
require('../methods/ticket/summary')(Self);