#167 remove some spaces in rotures/projects.ts

parent 2503a13e
......@@ -34,9 +34,7 @@ router.get('/my',auth, async (req:Request, res:Response): Promise<Response>=> {
if (rawProjects.length>0){
for(let project of rawProjects){
projectIds.push(project.id
)
}
}
)}}
const projects = await dataSource
.createQueryBuilder()
.from(Project, "project")
......@@ -53,8 +51,6 @@ router.get('/my',auth, async (req:Request, res:Response): Promise<Response>=> {
})
/**create new project */
router.post('/',auth, async (req:Request, res:Response): Promise<Response> => {
try{
......@@ -65,8 +61,7 @@ router.post('/',auth, async (req:Request, res:Response): Promise<Response> => {
.find({
where:{
title:title
}
})
}})
if(projectCheck.length>0) {return res.status(400).send({message:"suchc Project already exists"})}
const member:Member = new Member;
member.user= user;
......@@ -105,10 +100,7 @@ try{
where:{
project:{
id:req.params.id
}
}
}
)
}}})
return res.send({project, tasks})
} catch(e) {
return res.status(502).send({message:(e as Error).message})
......@@ -188,8 +180,7 @@ router.delete('/remove-user/:userId', authAdminProject,async (req: Request, res:
project:{
id:projectId
}
}
})
}})
if(!projectMember) return res.status(404).send({message:"this member is not present"})
await Member.delete({id:projectMember.id})
return res.send({message:"User removed from project successfully" })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment