db4.query('select * from password where password=$1',[req.body.pass])
.then((data)=>{
if(data.rows.length>0){
returndb.query('select * from skill_tree_data where class_id=$1 limit 1',[req.body.class_id])
}else{
varmsg="Could not authenticate!";res.status(500).send(msg);throwmsg
}
})
.then((data)=>{
if(data.rows.length>0){
returndb.query('update skill_tree_data set data=$1,skill_data=$2,line_color=$3,line_width=$4,gridsizex=$5,gridsizey=$6,gridpaddingx=$7,gridpaddingy=$8 where class_id=$9',
returndb.query('insert into skill_tree_data(data,skill_data,line_color,line_width,gridsizex,gridsizey,gridpaddingx,gridpaddingy,class_id) values($1,$2,$3,$4,$5,$6,$7,$8,$9)',
db4.query('select * from password where password=$1',[req.body.pass])
.then((data)=>{
if(data.rows.length>0){
returndb2.query('select * from skill_tree_data where class_id=$1 limit 1',[req.body.class_id])
}else{
varmsg="Could not authenticate!";res.status(500).send(msg);throwmsg
}
})
.then((data)=>{
if(data.rows.length>0){
returndb2.query('update skill_tree_data set data=$1,skill_data=$2,line_color=$3,line_width=$4,gridsizex=$5,gridsizey=$6,gridpaddingx=$7,gridpaddingy=$8 where class_id=$9',
returndb2.query('insert into skill_tree_data(data,skill_data,line_color,line_width,gridsizex,gridsizey,gridpaddingx,gridpaddingy,class_id) values($1,$2,$3,$4,$5,$6,$7,$8,$9)',