Skip to content

Instantly share code, notes, and snippets.

@milanvanschaik
Created May 22, 2014 20:49
Show Gist options
  • Save milanvanschaik/010a5d49f73aac93ca0c to your computer and use it in GitHub Desktop.
Save milanvanschaik/010a5d49f73aac93ca0c to your computer and use it in GitHub Desktop.
var users = require('../users');
var services = module.exports = {};
(function(services) {
'use strict';
services.setup = function(app) {
this.lookup = app.lookup.bind(app);
};
/**
* Find multiple users
* @method create
* @param {params} params
* @param {function} callback
*/
services.find = function(params, callback) {
//
};
/**
* Get a user by id
* @method get
* @param {id} id
* @param {params} params
* @param {function} callback
*/
services.get = function(id, params, callback) {
users.getById(id, function(result) {
if(!result) {
callback('NotFound', null);
}
else {
callback(null, result);
}
});
};
/**
* Create a new user
* @method create
* @param {data} data
* @param {params} params
* @param {function} callback
*/
services.create = function(data, params, callback) {
//
};
/**
* Update an existing user
* @method create
* @param {id} id
* @param {data} data
* @param {params} params
* @param {function} callback
*/
services.update = function(id, data, params, callback) {
//
};
/**
* Remove a user
* @method create
* @param {id} id
* @param {params} params
* @param {function} callback
*/
services.remove = function(id, params, callback) {
//
};
})(services);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment