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
92b0fd61
Commit
92b0fd61
authored
Jan 18, 2023
by
“Yevgeniy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#161
let to const rename, remove unused imports.
parent
3faff256
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
9 deletions
+5
-9
Task.ts
planner-api/src/models/Task.ts
+0
-3
tasks.ts
planner-api/src/routers/tasks.ts
+5
-6
No files found.
planner-api/src/models/Task.ts
View file @
92b0fd61
...
...
@@ -5,10 +5,7 @@ import {
CreateDateColumn
,
BaseEntity
,
ManyToOne
,
OneToOne
,
JoinTable
,
OneToMany
,
JoinColumn
}
from
'typeorm'
;
import
{
User
}
from
'./User'
;
import
{
Project
}
from
'./Project'
;
...
...
planner-api/src/routers/tasks.ts
View file @
92b0fd61
...
...
@@ -35,7 +35,7 @@ router.post('/', auth, async(req:Request, res:Response):Promise<Response>=>{
const
{
user
,
title
,
description
,
project
,
executor
,
dateTimeStart
,
dateTimeDue
,
dateTimeDeadLine
,
priority
,
calendar
}
=
req
.
body
;
let
dateTimeDueFinal
=
dateTimeDue
let
dateTimeStartFinal
=
dateTimeStart
le
t
dateTimeDeadlineFinal
=
dateTimeDeadLine
cons
t
dateTimeDeadlineFinal
=
dateTimeDeadLine
if
(
!
dateTimeDue
&&
dateTimeDeadLine
)
{
dateTimeDueFinal
=
dateTimeDeadLine
dateTimeStartFinal
=
subtractHours
(
dateTimeDueFinal
,
1
)
...
...
@@ -122,7 +122,6 @@ router.post('/users', auth, async(req:Request, res:Response):Promise<Response>=>
const
newTask
=
new
Task
();
newTask
.
title
=
title
;
newTask
.
description
=
description
;
const
currentTime
=
new
Date
();
if
(
project
)
{
const
watcherOfProject
=
await
dataSource
.
getRepository
(
Project
)
...
...
@@ -288,9 +287,9 @@ router.get('/related', auth,async (req: Request, res: Response):Promise<Response
.
where
(
"member.userId = :userId"
,
{
userId
:
user
.
id
})
.
getMany
()
let
projectIds
:
any
[]
=
[]
let
projectIds
:
string
[]
=
[]
if
(
tasks
.
length
>
0
){
for
(
le
t
task
of
tasks
){
for
(
cons
t
task
of
tasks
){
const
projectId
=
task
?.
project
?.
id
projectIds
.
push
(
projectId
)
}
...
...
@@ -389,7 +388,7 @@ router.put('/:taskId',auth,authAuthorOrExecutorOfTask,async(req:Request, res:Res
/** search all tasks on given projects: project Id array[] */
router
.
post
(
'/project'
,
async
(
req
:
Request
,
res
:
Response
):
Promise
<
Response
>=>
{
le
t
projectArray
:
string
[]
=
req
.
body
;
cons
t
projectArray
:
string
[]
=
req
.
body
;
try
{
if
(
projectArray
.
length
===
0
)
{
const
rawTasks
=
await
...
...
@@ -455,7 +454,7 @@ router.get('/users-tasks', auth,async (req: Request, res: Response):Promise<Resp
if
(
!
projectsWithTasks
)
return
res
.
status
(
404
).
send
({
Message
:
'projects not found'
})
let
tasks
:
Task
[]
=
[]
if
(
projectsWithTasks
.
length
>
0
)
{
for
(
le
t
project
of
projectsWithTasks
){
for
(
cons
t
project
of
projectsWithTasks
){
if
(
project
?.
tasks
)
{
tasks
=
tasks
.
concat
(
project
.
tasks
)
}
...
...
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