#89 fixing inputs on delete copytasks

parent acc32f52
...@@ -63,15 +63,16 @@ router.put("/change-copy", authAuthorOrExecutorOfTask, async(req:Request, res: R ...@@ -63,15 +63,16 @@ router.put("/change-copy", authAuthorOrExecutorOfTask, async(req:Request, res: R
}) })
/**delete copyTask by dateTimeTaskId */ /**delete copyTask by dateTimeTaskId */
router.delete('/:id', authAuthorOrExecutorOfTask, async(req:Request, res:Response):Promise<Response>=>{ router.delete('/:dateTimeTaskId', async(req:Request, res:Response):Promise<Response>=>{
const {id} = req.params // router.delete('/:dateTimeTaskId', authAuthorOrExecutorOfTask, async(req:Request, res:Response):Promise<Response>=>{
const {dateTimeTaskId} = req.params
await myDataSource await myDataSource
.createQueryBuilder() .createQueryBuilder()
.delete() .delete()
.from(DateTimeTask) .from(DateTimeTask)
.where("id = :id", { id }) .where("id = :dateTimeTaskId", { dateTimeTaskId })
.execute() .execute()
return res.send({message:"delete succesfully"}) return res.send({message:"copyTask delete succesfully"})
} }
) )
......
...@@ -54,16 +54,12 @@ const TableRowTask= ({ ...@@ -54,16 +54,12 @@ const TableRowTask= ({
const exp = roudHourUp(moment.utc(dateIso)).format("HH:"+"00") const exp = roudHourUp(moment.utc(dateIso)).format("HH:"+"00")
return exp; return exp;
} }
const getDayOfWeek = (dateIso) => { const getDayOfWeek = (dateIso) => {
const date = moment.utc(dateIso); const date = moment.utc(dateIso);
return weekDays[date.day()]; return weekDays[date.day()];
} }
// const handleEditDateTimeTask =(dateTimeTask)=>{
// console.log('edit handleEditDateTimeTask')
// }
return ( return (
<> <>
<TableRow hover key={task.id}> <TableRow hover key={task.id}>
......
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