copyTask delete router added

parent a09aa306
...@@ -62,4 +62,17 @@ router.put("change-copy", authAuthorOrExecutorOfTask, async(req:Request, res: Re ...@@ -62,4 +62,17 @@ router.put("change-copy", authAuthorOrExecutorOfTask, async(req:Request, res: Re
return res.send({message :"Something wrong in make-copy router"}) return res.send({message :"Something wrong in make-copy router"})
}) })
/**delete copyTask by dateTimeTaskId */
router.delete('/:id', authAuthorOrExecutorOfTask, async(req:Request, res:Response):Promise<Response>=>{
const {id} = req.params
await myDataSource
.createQueryBuilder()
.delete()
.from(DateTimeTask)
.where("id = :id", { id })
.execute()
return res.send({message:"delete succesfully"})
}
)
export default router; export default router;
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