Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
planner-team-one
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
21
Issues
21
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Евгений Положенцев
planner-team-one
Commits
523297dc
Commit
523297dc
authored
Dec 11, 2022
by
Евгений Положенцев
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#95
check if excutor could delete the last copytask is in progress
parent
705cbccc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
copyTasks.ts
planner-api/src/routers/copyTasks.ts
+20
-1
No files found.
planner-api/src/routers/copyTasks.ts
View file @
523297dc
...
@@ -46,9 +46,28 @@ router.put("/change-copy/:dateTimeTaskId", authAuthorOrExecutorOfTask, async(req
...
@@ -46,9 +46,28 @@ router.put("/change-copy/:dateTimeTaskId", authAuthorOrExecutorOfTask, async(req
/**delete copyTask by dateTimeTaskId */
/**delete copyTask by dateTimeTaskId */
router
.
delete
(
'/:dateTimeTaskId'
,
authAuthorOrExecutorOfDateTimeTask
,
async
(
req
:
Request
,
res
:
Response
):
Promise
<
Response
|
void
>=>
{
router
.
delete
(
'/:dateTimeTaskId'
,
authAuthorOrExecutorOfDateTimeTask
,
async
(
req
:
Request
,
res
:
Response
):
Promise
<
Response
|
void
>=>
{
const
{
executorStatus
}
=
req
.
body
const
{
executorStatus
,
authorStatus
}
=
req
.
body
if
(
executorStatus
){
if
(
executorStatus
){
const
{
dateTimeTaskId
}
=
req
.
params
const
{
dateTimeTaskId
}
=
req
.
params
const
task
=
await
dataSource
.
getRepository
(
Task
)
.
findOne
({
relations
:
{
dateTimeTasks
:
true
},
where
:{
dateTimeTasks
:
{
id
:
dateTimeTaskId
}
}})
if
(
executorStatus
)
{
const
deadLine
=
task
?.
dateTimeDeadLine
let
dateTimeTasks
=
task
?.
dateTimeTasks
const
deadlineTaskCopy
=
dateTimeTasks
?.
map
(
dateTimeTask
=>
{
if
(
dateTimeTask
.
dateTimeDue
===
deadLine
)
return
dateTimeTask
})
}
await
myDataSource
await
myDataSource
.
createQueryBuilder
()
.
createQueryBuilder
()
.
delete
()
.
delete
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment