Skip to content

Commit

Permalink
remove callback function from utility method, #35
Browse files Browse the repository at this point in the history
  • Loading branch information
SteffenGorenflo committed Jul 30, 2015
1 parent 90d79c7 commit 98bb07e
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/util/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@ class Util {
* @param element
* @param callback
*/
createDocument = (element, callback) => {
callback = callback || this.noop;
createDocument = (element) => {
var date = new Date();
element.create_date = date.toISOString();

return new Promise((resolve, reject) => {

this.db.save(element, (err, data) => {

callback(err, data);
if (err) {
return reject(Boom.badRequest(err));
}
Expand Down Expand Up @@ -453,9 +451,4 @@ class Util {
})
})
};
/**
* empty pseudo callback
*/
noop = () => {
};
}

0 comments on commit 98bb07e

Please sign in to comment.