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
0fd7c5eb
Commit
0fd7c5eb
authored
Nov 17, 2022
by
Евгений Положенцев
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#51
try to optimize mmyTasks, no result
parent
61f618b6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
11 deletions
+13
-11
MyTasks.js
planner-front/src/containers/MyTasks/MyTasks.js
+9
-10
tasksActions.js
planner-front/src/store/actions/tasksActions.js
+1
-1
tasksReducer.js
planner-front/src/store/reducers/tasksReducer.js
+3
-0
No files found.
planner-front/src/containers/MyTasks/MyTasks.js
View file @
0fd7c5eb
...
...
@@ -58,20 +58,18 @@ function stableSort(array, comparator) {
export
default
function
EnhancedTable
()
{
const
dispatch
=
useDispatch
();
useEffect
(()
=>
{
dispatch
(
fetchAllTasks
());
dispatch
(
fetch
)
},
[
dispatch
]);
const
tasks
=
useSelector
((
state
)
=>
state
.
tasks
.
tasks
);
console
.
log
(
tasks
)
const
[
recievedTasks
,
setRecievedTasks
]
=
useState
([]);
const
[
projects
,
setProjects
]
=
useState
([])
// const projects=[
// "project1",
// "project2",
// "project3"
// ]
const
[
projects
,
setProjects
]
=
useState
([
'1'
,
'2'
])
useEffect
(()
=>
{
dispatch
(
fetchAllTasks
());
},
[
dispatch
]);
const
[
order
,
setOrder
]
=
React
.
useState
(
"asc"
);
const
[
orderBy
,
setOrderBy
]
=
React
.
useState
(
"id"
);
...
...
@@ -257,6 +255,7 @@ console.log(tasks)
onClick
=
{()
=>
{
addTask
();
}}
projects
=
{
projects
}
onClose
=
{
onClose
}
projectName
=
{
projectName
}
...
...
planner-front/src/store/actions/tasksActions.js
View file @
0fd7c5eb
...
...
@@ -156,7 +156,7 @@ export const fetchTasksByProject = (projects) => {
return
async
(
dispatch
)
=>
{
dispatch
(
fetchTasksByProjectRequest
());
try
{
await
axios
.
post
(
"/tasks/project"
,
projects
);
const
response
=
await
axios
.
post
(
"/tasks/project"
,
projects
);
dispatch
(
fetchTasksByProjectSuccess
(
response
.
data
.
tasks
))
}
catch
(
error
)
{
dispatch
(
fetchTasksByProjectFailure
(
error
.
response
.
data
));
...
...
planner-front/src/store/reducers/tasksReducer.js
View file @
0fd7c5eb
...
...
@@ -13,6 +13,9 @@ import {
DELETE_TASK_FAILURE
,
FETCH_ALL_TASKS_SUCCESS
,
EDIT_CALENDAR_TASK
,
FETCH_TASKS_BY_PROJECT_REQUEST
,
FETCH_TASKS_BY_PROJECT_SUCCESS
,
FETCH_TASKS_BY_PROJECT_FAILURE
}
from
"../actionTypes/tasksTypes"
;
const
initialState
=
{
...
...
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