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
90ee43c8
Commit
90ee43c8
authored
Dec 14, 2022
by
Евгений Положенцев
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#106
edit copy task by author enabled
parent
808b2857
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
copyTasks.ts
planner-api/src/routers/copyTasks.ts
+6
-2
ProfileBlock.js
...r-front/src/components/Menus/ProfileBlock/ProfileBlock.js
+2
-2
No files found.
planner-api/src/routers/copyTasks.ts
View file @
90ee43c8
...
@@ -23,6 +23,12 @@ router.post("/make-copy",authAuthorOrExecutorOfTask, async(req:Request, res:Resp
...
@@ -23,6 +23,12 @@ router.post("/make-copy",authAuthorOrExecutorOfTask, async(req:Request, res:Resp
router
.
put
(
"/change-copy/:dateTimeTaskId"
,
authAuthorOrExecutorOfTask
,
async
(
req
:
Request
,
res
:
Response
):
Promise
<
Response
>=>
{
router
.
put
(
"/change-copy/:dateTimeTaskId"
,
authAuthorOrExecutorOfTask
,
async
(
req
:
Request
,
res
:
Response
):
Promise
<
Response
>=>
{
const
{
dateTimeTaskId
}
=
req
.
params
const
{
dateTimeTaskId
}
=
req
.
params
const
{
executorStatus
,
authorStatus
,
task
,
dateTimeStart
,
dateTimeDue
,
description
,
title
,
priority
}
=
req
.
body
const
{
executorStatus
,
authorStatus
,
task
,
dateTimeStart
,
dateTimeDue
,
description
,
title
,
priority
}
=
req
.
body
if
(
authorStatus
){
task
.
title
=
title
;
task
.
description
=
description
;
task
.
priority
=
priority
;
await
task
.
save
()
}
const
dateTimeTask
=
await
dataSource
const
dateTimeTask
=
await
dataSource
.
createQueryBuilder
()
.
createQueryBuilder
()
.
select
(
'dateTimeTask'
)
.
select
(
'dateTimeTask'
)
...
@@ -103,12 +109,10 @@ router.delete('/:dateTimeTaskId',authAuthorOrExecutorOfDateTimeTask, async(req:R
...
@@ -103,12 +109,10 @@ router.delete('/:dateTimeTaskId',authAuthorOrExecutorOfDateTimeTask, async(req:R
if
(
dateTimeTasks
.
length
===
1
)
{
if
(
dateTimeTasks
.
length
===
1
)
{
if
(
authorStatus
)
{
if
(
authorStatus
)
{
Task
.
remove
(
task
)
Task
.
remove
(
task
)
return
res
.
send
({
message
:
"task delete succesfully"
})
return
res
.
send
({
message
:
"task delete succesfully"
})
}
else
{
}
else
{
return
res
.
send
({
message
:
"not uathorized to delete task"
})
return
res
.
send
({
message
:
"not uathorized to delete task"
})
}
}
}
}
}
}
...
...
planner-front/src/components/Menus/ProfileBlock/ProfileBlock.js
View file @
90ee43c8
import
{
Button
,
Menu
,
MenuItem
}
from
"@mui/material"
;
import
{
Button
,
Menu
,
MenuItem
}
from
"@mui/material"
;
import
{
useState
,
useEffect
}
from
"react"
;
import
{
useState
}
from
"react"
;
import
{
useDispatch
,
useSelector
}
from
"react-redux"
;
import
{
useDispatch
,
useSelector
}
from
"react-redux"
;
import
{
NavLink
,
useNavigate
}
from
"react-router-dom"
;
import
{
NavLink
,
useNavigate
}
from
"react-router-dom"
;
import
{
fetchUsersAllFields
,
fetchUsers
,
logoutUser
}
from
"../../../store/actions/usersActions"
;
import
{
fetchUsersAllFields
,
logoutUser
}
from
"../../../store/actions/usersActions"
;
import
SwitchUserModal
from
"../../SwitchUserModal/SwitchUserModal"
;
import
SwitchUserModal
from
"../../SwitchUserModal/SwitchUserModal"
;
const
ProfileBlock
=
()
=>
{
const
ProfileBlock
=
()
=>
{
...
...
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