update
added: db users admin user edit cleared router cleared sql new sid creation new log creation cleaned code (a bit) ( removed db check value function and replaced with get one value.
This commit is contained in:
10
object.js
10
object.js
@ -27,15 +27,15 @@ module.exports.load = (inp,cook,res)=>{
|
||||
|
||||
module.exports.new = (inp,cook,res)=>{
|
||||
try {
|
||||
db.cv("objects","name",inp["name"],(include)=>{
|
||||
if(include){
|
||||
db.ggv("objects","id","name",`'${inp["name"]}'`,(db_name)=>{db_name= db_name[0]
|
||||
if(db_name != null){
|
||||
res.send({out:"bad",err:"name"});
|
||||
}
|
||||
else if (!include){
|
||||
db.nr("objects","`name`,`img`,`height`,`width`,`description`",`'${inp["name"]}','${inp["img"]}','${inp["height"]}','${inp["width"]}','${inp["desc"]}'`);
|
||||
else if (db_name == null){
|
||||
db.nr("objects","`name`,`img`,`height`,`width`,`description`",`'${inp["name"]}','${inp["img"]}','${inp["height"]}','${inp["width"]}','${inp["desc"]}'`,true);
|
||||
res.send({out:"good"});
|
||||
}
|
||||
})
|
||||
},true)
|
||||
} catch (error) {
|
||||
func.log("backend object creating error - "+error);
|
||||
}
|
||||
|
Reference in New Issue
Block a user