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
51da2296
Commit
51da2296
authored
Jan 17, 2023
by
Ermolaev Timur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#157
пофиксил баги при создание нового проекта
parent
732adcdf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
10 deletions
+9
-10
projects.ts
planner-api/src/routers/projects.ts
+1
-1
FullProject.js
planner-front/src/containers/FullProject/FullProject.js
+0
-2
Projects.js
planner-front/src/containers/Projects/Projects.js
+5
-4
projectsActions.js
planner-front/src/store/actions/projectsActions.js
+3
-3
No files found.
planner-api/src/routers/projects.ts
View file @
51da2296
...
...
@@ -49,7 +49,6 @@ router.get('/my',auth, async (req:Request, res:Response): Promise<Response>=> {
/**create new project */
router
.
post
(
'/'
,
auth
,
async
(
req
:
Request
,
res
:
Response
):
Promise
<
Response
>
=>
{
if
(
!
req
.
body
)
return
res
.
status
(
400
).
send
({
Message
:
'problem in incoming req.body'
})
const
{
user
,
title
,
color
}
=
req
.
body
;
...
...
@@ -86,6 +85,7 @@ router.post('/',auth, async (req:Request, res:Response): Promise<Response> => {
})
/**get project with all FK & tasks with all FK, by project ID */
router
.
get
(
"/:id"
,
async
(
req
:
Request
,
res
:
Response
):
Promise
<
Response
>
=>
{
const
project
=
await
dataSource
.
createQueryBuilder
()
.
select
(
"project"
)
...
...
planner-front/src/containers/FullProject/FullProject.js
View file @
51da2296
...
...
@@ -27,8 +27,6 @@ const FullProject = ({ projectId }) => {
useEffect
(()
=>
{
if
(
projectId
)
{
dispatch
(
fetchProject
(
projectId
))
}
else
{
dispatch
(
fetchProject
(
params
.
id
))
}
dispatch
(
fetchUsers
())
},
[
params
.
id
,
dispatch
,
projectId
]);
...
...
planner-front/src/containers/Projects/Projects.js
View file @
51da2296
...
...
@@ -32,8 +32,9 @@ const Projects = () => {
},
[])
const
createNewProjectHandler
=
useCallback
(()
=>
{
dispatch
(
createProject
({
title
:
projectTitle
,
user
:
user
.
id
},
navigate
))
},
[
dispatch
,
projectTitle
,
user
.
id
,
navigate
])
dispatch
(
createProject
({
title
:
projectTitle
,
user
:
user
.
id
}))
setModal
(
false
)
},
[
dispatch
,
projectTitle
,
user
.
id
])
const
deleteProjectHandler
=
useCallback
((
e
,
projectId
)
=>
{
e
.
stopPropagation
();
...
...
@@ -49,7 +50,7 @@ const Projects = () => {
},
[])
console
.
log
(
currentProject
)
return
<>
<
Grid
container
justifyContent
=
'space-between'
>
...
...
@@ -62,7 +63,7 @@ const Projects = () => {
/
>
<
Grid
item
xs
=
{
7
}
>
{
currentProject
?
<
FullProject
projectId
=
{
currentProject
?.
id
}
/> : null
}
{
currentProject
?
<
FullProject
projectId
=
{
currentProject
?.
id
?
currentProject
?.
id
:
null
}
/> : null
}
<
/Grid
>
<
/Grid
>
...
...
planner-front/src/store/actions/projectsActions.js
View file @
51da2296
...
...
@@ -96,12 +96,12 @@ export const fetchProject = (id) => {
}
};
export
const
createProject
=
(
projectData
,
navigate
)
=>
{
export
const
createProject
=
(
projectData
)
=>
{
return
async
(
dispatch
)
=>
{
try
{
const
response
=
await
axios
.
post
(
"/projects"
,
projectData
);
await
axios
.
post
(
"/projects"
,
projectData
);
dispatch
(
createProjectSuccess
());
navigate
(
"/projects/"
+
response
.
data
.
project
.
id
)
dispatch
(
fetchProjects
()
)
dispatch
(
showNotification
(
"Проект успешно создан"
))
}
catch
(
e
)
{
console
.
log
(
e
);
...
...
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