Commit 341f950a authored by Ermolaev Timur's avatar Ermolaev Timur

Merge branch 'task-91-enhance/add_deadline' into 'development'

#91 Засунул дедлайн, подправил запросы

See merge request !67
parents 1f23241a f09c5cc1
......@@ -158,18 +158,17 @@ function MonthCalendar() {
...currentTask,
dateTimeStart: start,
dateTimeDue: due,
dateTimeTaskId: currentTask.id,
taskId: currentTask.mainTaskId
}
delete newTask.infoForCell
delete newTask.id
await dispatch(editCalendarTask(newTask))
await dispatch(editCalendarTask(newTask, currentTask.id))
} else {
const newTask = {
...currentTask,
dateTimeStart: start,
dateTimeDue: due,
executor: user,
dateTimeDeadLine: due,
}
delete newTask.infoForCell
delete newTask.id
......
......@@ -77,7 +77,7 @@ export const addCalendarTask = (task) => {
return async (dispatch) => {
dispatch(addTaskRequest());
try {
const response = await axios.post("/tasks", task);
await axios.post("/tasks", task);
dispatch(addTaskSuccess())
dispatch(fetchCalendarTasks())
} catch (error) {
......@@ -90,7 +90,7 @@ export const addCopyCalendarTask = (task) => {
return async (dispatch) => {
dispatch(addTaskRequest());
try {
const response = await axios.post("/copy-tasks/make-copy", task);
await axios.post("/copy-tasks/make-copy", task);
dispatch(addTaskSuccess())
dispatch(fetchCalendarTasks())
} catch (error) {
......@@ -137,11 +137,11 @@ export const editTask = (task) => {
}
}
export const editCalendarTask = (task) => {
export const editCalendarTask = (task, taskId) => {
return async (dispatch) => {
dispatch(editTaskRequest());
try {
await axios.put("/copy-tasks/change-copy", task);
await axios.put(`/copy-tasks/change-copy/${taskId}`, task);
dispatch(editTaskSuccess())
dispatch(fetchCalendarTasks())
} catch (error) {
......
......@@ -12,7 +12,6 @@ import {
DELETE_TASK_REQUEST,
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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment