mirror of
https://gitlab.silvrtree.co.uk/martind2000/obrandDBWork.git
synced 2025-01-10 20:55:07 +00:00
39 lines
1.1 KiB
JavaScript
39 lines
1.1 KiB
JavaScript
|
/**
|
||
|
*
|
||
|
* 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();
|
||
|
});
|
||
|
|