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
705cbccc
Commit
705cbccc
authored
Dec 11, 2022
by
Евгений Положенцев
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#95
clean up
parent
60034603
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
22 deletions
+2
-22
copyTasks.ts
planner-api/src/routers/copyTasks.ts
+2
-22
No files found.
planner-api/src/routers/copyTasks.ts
View file @
705cbccc
import
express
,{
Router
,
Request
,
Response
,
NextFunction
}
from
'express'
;
import
express
,{
Router
,
Request
,
Response
}
from
'express'
;
import
{
Task
}
from
'../models/Task'
;
import
{
Task
}
from
'../models/Task'
;
import
{
myDataSource
}
from
'../app-data-source'
;
import
{
myDataSource
}
from
'../app-data-source'
;
import
{
User
}
from
'../models/User'
;
import
{
Member
}
from
'../models/Member'
;
import
{
In
}
from
'typeorm'
;
import
{
DateTimeTask
}
from
'../models/DateTimeTask'
;
import
{
DateTimeTask
}
from
'../models/DateTimeTask'
;
import
{
auth
,
authAuthorOrExecutorOfDateTimeTask
,
authAuthorOrExecutorOfTask
}
from
'../helpers'
;
import
{
auth
,
authAuthorOrExecutorOfDateTimeTask
,
authAuthorOrExecutorOfTask
,
taskFinderById
}
from
'../helpers'
;
const
router
:
Router
=
express
.
Router
();
const
router
:
Router
=
express
.
Router
();
const
dataSource
=
myDataSource
;
const
dataSource
=
myDataSource
;
/**task finder by id, return one task */
const
taskFinderById
=
async
(
taskId
:
string
):
Promise
<
null
|
Task
>=>
{
const
task
=
await
dataSource
.
getRepository
(
Task
)
.
findOne
({
relations
:{
executor
:
true
,
author
:
true
,
dateTimeTasks
:
true
},
where
:{
id
:
taskId
}
})
return
task
}
/** make copy of task in calendar view */
/** make copy of task in calendar view */
router
.
post
(
"/make-copy"
,
authAuthorOrExecutorOfTask
,
async
(
req
:
Request
,
res
:
Response
):
Promise
<
Response
>=>
{
router
.
post
(
"/make-copy"
,
authAuthorOrExecutorOfTask
,
async
(
req
:
Request
,
res
:
Response
):
Promise
<
Response
>=>
{
...
...
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