How to use the restitute.controller.list function in restitute

To help you get started, we’ve selected a few restitute examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gadael / gadael / rest / account / timesavingaccounts.js View on Github external
'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];
github gadael / gadael / rest / admin / compulsoryleaves.js View on Github external
'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 }));
}
github gadael / gadael / rest / manager / collaborators.js View on Github external
'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
];
github gadael / gadael / rest / admin / waitingrequests.js View on Github external
'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() {
github gadael / gadael / rest / admin / rightrenewals.js View on Github external
'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'));
}

restitute

A nodejs controller libraray to create a JSON REST service

MIT
Latest version published 4 years ago

Package Health Score

42 / 100
Full package analysis