Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict';
var ctrlFactory = require('restitute').controller;
function listController() {
ctrlFactory.list.call(this, '/rest/account/timesavingaccounts');
this.controllerAction = function() {
this.jsonService(this.service('user/timesavingaccounts/list', { account: this.req.user.roles.account.id }));
};
}
listController.prototype = new ctrlFactory.list();
exports = module.exports = [listController];
'use strict';
var ctrlFactory = require('restitute').controller;
function listController() {
ctrlFactory.list.call(this, '/rest/admin/compulsoryleaves');
this.controllerAction = function() {
this.jsonService(this.service('admin/compulsoryleaves/list'));
};
}
listController.prototype = new ctrlFactory.list();
function getController() {
ctrlFactory.get.call(this, '/rest/admin/compulsoryleaves/:id');
this.controllerAction = function() {
this.jsonService(this.service('admin/compulsoryleaves/get'));
};
}
getController.prototype = new ctrlFactory.get();
function save() {
this.jsonService(this.service('admin/compulsoryleaves/save', { userCreated: this.req.user }));
}
'use strict';
var ctrlFactory = require('restitute').controller;
function listController() {
ctrlFactory.list.call(this, '/rest/manager/collaborators');
this.controllerAction = function() {
this.jsonService(this.service('user/collaborators/list', { user: this.req.user.id, manager: true }));
};
}
listController.prototype = new ctrlFactory.list();
exports = module.exports = [
listController
];
'use strict';
var ctrlFactory = require('restitute').controller;
function listController() {
ctrlFactory.list.call(this, '/rest/admin/waitingrequests');
this.controllerAction = function() {
this.jsonService(this.service('manager/waitingrequests/list'));
};
}
listController.prototype = new ctrlFactory.list();
function getController() {
ctrlFactory.get.call(this, '/rest/admin/waitingrequests/:id');
this.controllerAction = function() {
this.jsonService(this.service('manager/waitingrequests/get'));
};
}
getController.prototype = new ctrlFactory.get();
/**
* Confirm or reject a waiting request instead of a manager
*/
function updateController() {
'use strict';
var ctrlFactory = require('restitute').controller;
function listController() {
ctrlFactory.list.call(this, '/rest/admin/rightrenewals');
this.controllerAction = function() {
this.jsonService(this.service('admin/rightrenewals/list'));
};
}
listController.prototype = new ctrlFactory.list();
function getController() {
ctrlFactory.get.call(this, '/rest/admin/rightrenewals/:id');
this.controllerAction = function() {
this.jsonService(this.service('admin/rightrenewals/get'));
};
}
getController.prototype = new ctrlFactory.get();
function save() {
this.jsonService(this.service('admin/rightrenewals/save'));
}