obrandDBWork/mock.js

39 lines
1.1 KiB
JavaScript
Raw Normal View History

2016-03-15 14:49:39 +00:00
/**
*
* User: Martin Donnelly
* Date: 2016-03-09
* Time: 15:18
*
*/
var dbAccounts = require('units/db-accounts');
var log4js = require('log4js');
var logger = log4js.getLogger();
var dbAccount = dbAccounts;
var profileData = {
forename:'Tim',
surname:'Timmington',
gender:0,
dob:'2000-01-01',
bio:'He is forbidden from walking through cemetaries, because of that one incident where he raised the dead'
};
return dbAccount.findAccount({
password: 'b0b5p455w0rd',
email: 'bob@tim.com'
})
.then(function(data) {
profileData.uid = data.uid;
return dbAccount.addInsertProfile(profileData)
.then(function(sqlResponse){
logger.debug(sqlResponse);
});
})
.catch(function(err) {
console.log(err);
//err.should.not.be.ok();
});