Skip to content

Instantly share code, notes, and snippets.

@laerciobernardo
Created March 29, 2017 20:56
Show Gist options
  • Save laerciobernardo/0362ad93095ae9ab11534eaaa5c2606a to your computer and use it in GitHub Desktop.
Save laerciobernardo/0362ad93095ae9ab11534eaaa5c2606a to your computer and use it in GitHub Desktop.
'use strict'
const Model = require('../models/company');
const create = (obj) => {
return Model.create(obj);
};
const remove = (uid) => {
let query = {uid: uid};
return Model.remove(query);
};
const update = (uid, obj) => {
let query = {uid: uid};
return Model.update(query, obj);
};
const addClient = (uid, obj) =>{
}
const get = (uid) => {
let query = {uid: uid};
return Model.findOne(query);
};
const list = () => {
let query = {};
return Model.find(query);
};
module.exports = {
create,
remove,
update,
get,
list
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment