Skip to content

Commit

Permalink
style: apply code format
Browse files Browse the repository at this point in the history
  • Loading branch information
lykmapipo committed Jun 8, 2020
1 parent 81265f9 commit ae19d80
Show file tree
Hide file tree
Showing 38 changed files with 613 additions and 613 deletions.
2 changes: 1 addition & 1 deletion lib/campaign.http.router.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,4 +315,4 @@ router.delete(
);

/* expose campaign router */
module.exports = exports = router;
module.exports = exports = router;
4 changes: 3 additions & 1 deletion lib/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ const { toE164 } = require('@lykmapipo/phone');
*/
exports.toE164 = toE164;

// TODO: createContactSchema(schema, optns = { callingCode, mobilePrefix });

/**
* @description contact sub schema
* @author lally elias <lallyelias87@gmail.com>
Expand All @@ -42,7 +44,7 @@ exports.Contact = createSubSchema({
index: true,
searchable: true,
taggable: true,
fake: faker => faker.helpers.replaceSymbolWithNumber('255714######'),
fake: (faker) => faker.helpers.replaceSymbolWithNumber('255714######'),
},
email: {
type: String,
Expand Down
18 changes: 9 additions & 9 deletions lib/message.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ MessageSchema.methods.isHtml = function _isHtml() {
* @version 0.1.0
* @private
*/
MessageSchema.methods._send = function(done) {
MessageSchema.methods._send = function (done) {
//this refer to Message instance context

try {
Expand All @@ -771,7 +771,7 @@ MessageSchema.methods._send = function(done) {
//send message via transport
transport.send(
this,
function(error, result) {
function (error, result) {
//prepare result
let _result = _.merge(
{},
Expand Down Expand Up @@ -905,7 +905,7 @@ MessageSchema.methods.queue = function queue(done) {
}

//persist message
this.save(function(error, message) {
this.save(function (error, message) {
//notify error
if (error) {
worker.queue.emit('job error', error);
Expand Down Expand Up @@ -936,7 +936,7 @@ MessageSchema.methods.queue = function queue(done) {
const job = message.runInBackground(jobDetails);

//ensure message has been queued
return job.save(function(error) {
return job.save(function (error) {
if (error) {
worker.queue.emit('job error', error);
return cb(error);
Expand Down Expand Up @@ -1127,8 +1127,8 @@ MessageSchema.statics.resend = function resend(criteria, done) {
if (unsents) {
/* @todo make use of parallelism */
//prepare send work
unsents = _.map(unsents, function(unsent) {
return function(_next) {
unsents = _.map(unsents, function (unsent) {
return function (_next) {
unsent.send(_next); /* @todo spies test */
};
});
Expand Down Expand Up @@ -1160,7 +1160,7 @@ MessageSchema.statics.resend = function resend(criteria, done) {
* Message.requeue(criteria);
*
*/
MessageSchema.statics.requeue = function(criteria) {
MessageSchema.statics.requeue = function (criteria) {
//this refer to Message static context

/* @todo use stream */
Expand All @@ -1172,7 +1172,7 @@ MessageSchema.statics.requeue = function(criteria) {
const Message = this;

//find all unsent message(s) for requeue
Message.unsent(_criteria, function(error, unsents) {
Message.unsent(_criteria, function (error, unsents) {
//there is no message queue
if (!worker.queue) {
if (error) {
Expand All @@ -1193,7 +1193,7 @@ MessageSchema.statics.requeue = function(criteria) {
worker.queue.emit('job success', unsents);

//re-queue unsent message
_.forEach(unsents, function(unsent) {
_.forEach(unsents, function (unsent) {
unsent.queue();
});
}
Expand Down
Loading

0 comments on commit ae19d80

Please sign in to comment.