deprecated changeWorker as it is no longer in use
This commit is contained in:
parent
2c3f46f394
commit
708c0035c0
|
@ -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);
|
||||
});
|
||||
}
|
||||
};
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue