added project deleting

This commit is contained in:
2023-07-14 10:47:53 +05:00
parent 1a88b8bb64
commit f57fec5cde
8 changed files with 47 additions and 101 deletions

View File

@ -39,6 +39,22 @@ module.exports.loads = (inp,cook,res)=>{
}
}
module.exports.del = (inp,cook,res)=>{
try {
db.ggv("users","`id`","uuid",`'${cook["uuid"]}'`,(udata)=>{ udata = udata[0];
db.gv("projects","name",`'${inp["name"]}'`,(pdata)=>{pdata=pdata[0]
// res.send({out:"good",body:pdata});
db.dl("projects","id",pdata["id"],()=>{
res.send({out:"good"});
func.log(`good boy ${udata["uuid"]} deleted project ${inp["name"]} from ${cook["sid"]}`);
})
})
})
} catch (error) {
func.log("backend projects delete err0r - " - error);
}
}
module.exports.save = (inp,cook,res)=>{
try {
db.gv("users","uuid",`'${cook["uuid"]}'`, (udata)=>{ udata = udata[0]