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
09cd2acf
Commit
09cd2acf
authored
Dec 17, 2022
by
Евгений Положенцев
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#110
added raw action fetch all tasks by member
parent
168d7e7c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
2 deletions
+34
-2
tasksTypes.js
planner-front/src/store/actionTypes/tasksTypes.js
+5
-1
tasksActions.js
planner-front/src/store/actions/tasksActions.js
+29
-1
No files found.
planner-front/src/store/actionTypes/tasksTypes.js
View file @
09cd2acf
...
...
@@ -24,4 +24,8 @@ export const EDIT_CALENDAR_TASK = "EDIT_CALENDAR_TASK";
export
const
DELETE_DATETIMETASK_REQUEST
=
"DELETE_TASK_REQUEST"
;
export
const
DELETE_DATETIMETASK_SUCCESS
=
"DELETE_TASK_SUCCESS"
;
export
const
DELETE_DATETIMETASK_FAILURE
=
"DELETE_TASK_FAILURE"
;
\ No newline at end of file
export
const
DELETE_DATETIMETASK_FAILURE
=
"DELETE_TASK_FAILURE"
;
export
const
FETCH_ALL_TASKS_BY_MEMBERSHIP_REQUEST
=
"FETCH_ALL_TASKS_BY_MEMBERSHIP_REQUEST"
;
export
const
FETCH_ALL_TASKS_BY_MEMBERSHIP_SUCCESS
=
"FETCH_ALL_TASKS_BY_MEMBERSHIP_SUCCESS"
;
export
const
FETCH_ALL_TASKS_BY_MEMBERSHIP_FAILURE
=
"FETCH_ALL_TASKS_BY_MEMBERSHIP_FAILURE"
;
\ No newline at end of file
planner-front/src/store/actions/tasksActions.js
View file @
09cd2acf
...
...
@@ -61,8 +61,36 @@ export const fetchAllTasks = () => {
}
}
};
//**fetch tasks for table UsersTasks, start*/
const
fetchAllTasksByMembershipSuccess
=
(
tasks
)
=>
{
return
{
type
:
FETCH_ALL_TASKS_SUCCESS
,
tasks
}
};
const
fetchUsersTasksFailure
=
(
error
)
=>
{
return
{
type
:
FETCH_CALENDAR_TASKS_FAILURE
,
error
}
};
export
const
fetcAllTasksByMembership
=
()
=>
{
return
async
(
dispatch
)
=>
{
dispatch
(
fetchCalendarTasksRequest
());
try
{
const
response
=
await
axios
.
get
(
"/tasks/users-tasks"
);
dispatch
(
fetchAllTasksByMembershipSuccess
(
response
.
data
.
tasks
))
}
catch
(
error
)
{
dispatch
(
fetchCalendarTasksFailure
(
error
.
response
.
data
));
}
}
};
//**end*/
const
addTaskRequest
=
()
=>
{
return
{
type
:
ADD_NEW_TASK_REQUEST
}
return
{
type
:
ADD_NEW_TASK_REQUEST
}
};
const
addTaskSuccess
=
()
=>
{
...
...
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