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
72e00819
Commit
72e00819
authored
Nov 16, 2022
by
Ermolaev Timur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#38
Убрал предупреждния, чуть оптимизировал
parent
2a92b77a
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
25 additions
and
39 deletions
+25
-39
App.js
planner-front/src/App.js
+1
-0
CalendarRow.js
...c/components/MonthCalendarBody/CalendarRow/CalendarRow.js
+0
-1
CalendarRowDay.js
...onents/MonthCalendarBody/CalendarRowDay/CalendarRowDay.js
+10
-10
CalendarStandartCell.js
...endarBody/CalendarStandartCell.js/CalendarStandartCell.js
+1
-1
CalendarTask.js
...components/MonthCalendarBody/CalendarTask/CalendarTask.js
+5
-17
MonthCalendarBody.js
...ont/src/components/MonthCalendarBody/MonthCalendarBody.js
+2
-4
СustomSelect.js
planner-front/src/components/UI/СustomSelect/СustomSelect.js
+3
-3
MonthCalendar.js
planner-front/src/containers/MonthCalendar/MonthCalendar.js
+2
-2
tasksActions.js
planner-front/src/store/actions/tasksActions.js
+1
-1
No files found.
planner-front/src/App.js
View file @
72e00819
...
@@ -18,6 +18,7 @@ const ProtectedRoute = ({isAllowed, roles, redirectUrl, children}) => {
...
@@ -18,6 +18,7 @@ const ProtectedRoute = ({isAllowed, roles, redirectUrl, children}) => {
const
App
=
()
=>
{
const
App
=
()
=>
{
const
user
=
useSelector
(
state
=>
state
.
users
?.
user
);
const
user
=
useSelector
(
state
=>
state
.
users
?.
user
);
console
.
log
(
user
)
return
(
return
(
<
BrowserRouter
>
<
BrowserRouter
>
<
Routes
>
<
Routes
>
...
...
planner-front/src/components/MonthCalendarBody/CalendarRow/CalendarRow.js
View file @
72e00819
import
{
Grid
}
from
"@mui/material"
;
import
{
Grid
}
from
"@mui/material"
;
import
{
memo
}
from
"react"
;
const
CalendarRow
=
({
children
})
=>
{
const
CalendarRow
=
({
children
})
=>
{
return
<>
return
<>
...
...
planner-front/src/components/MonthCalendarBody/CalendarRowDay/CalendarRowDay.js
View file @
72e00819
...
@@ -7,20 +7,20 @@ const CalendarRowDay = ({xs, hoursInDay, createTaskInCellHandler, currentTask, h
...
@@ -7,20 +7,20 @@ const CalendarRowDay = ({xs, hoursInDay, createTaskInCellHandler, currentTask, h
const
hours
=
useMemo
(()
=>
{
const
hours
=
useMemo
(()
=>
{
return
hoursInDay
.
map
((
hour
)
=>
parseInt
(
hour
.
split
(
':'
)[
0
]))},
return
hoursInDay
.
map
((
hour
)
=>
parseInt
(
hour
.
split
(
':'
)[
0
]))},
[
hour
Format
])
[
hour
sInDay
])
const
availableTasks
=
useMemo
(()
=>
{
const
availableTasks
=
useMemo
(()
=>
{
const
tasksInDay
=
tasks
.
filter
(
task
=>
{
const
tasksInDay
=
tasks
.
filter
(
(
task
)
=>
{
if
(
year
===
task
.
infoForCell
.
startYear
)
{
if
(
year
===
task
.
infoForCell
.
startYear
)
{
if
(
month
+
1
===
task
.
infoForCell
.
startMonth
)
{
if
(
month
+
1
===
task
.
infoForCell
.
startMonth
)
{
if
(
day
.
dayNumber
===
task
.
infoForCell
.
startDay
)
{
if
(
day
.
dayNumber
===
task
.
infoForCell
.
startDay
)
{
return
task
return
task
}
}
else
{
return
false
}
}
}
else
{
return
false
}
}
}
else
{
return
false
}
})
})
return
tasksInDay
return
tasksInDay
},
[
tasks
,
month
])
},
[
tasks
,
month
,
year
,
day
.
dayNumber
])
const
sortedTasks
=
useMemo
(()
=>
{
const
sortedTasks
=
useMemo
(()
=>
{
if
(
availableTasks
.
length
)
{
if
(
availableTasks
.
length
)
{
...
@@ -65,7 +65,7 @@ const CalendarRowDay = ({xs, hoursInDay, createTaskInCellHandler, currentTask, h
...
@@ -65,7 +65,7 @@ const CalendarRowDay = ({xs, hoursInDay, createTaskInCellHandler, currentTask, h
if
(
!
isNaN
(
line
[
i
]))
{
if
(
!
isNaN
(
line
[
i
]))
{
for
(
let
a
=
0
;
a
<
hours
.
length
;
a
++
)
{
for
(
let
a
=
0
;
a
<
hours
.
length
;
a
++
)
{
const
hour
=
hours
[
a
]
const
hour
=
hours
[
a
]
if
(
task
.
infoForCell
.
endMinute
===
59
&&
task
.
infoForCell
.
endHour
===
hour
+
hourDiffEnd
||
(
!
hourFormat
&&
task
.
infoForCell
.
endMinute
===
59
&&
task
.
infoForCell
.
endHour
===
hour
))
{
if
(
(
task
.
infoForCell
.
endMinute
===
59
&&
task
.
infoForCell
.
endHour
===
hour
+
hourDiffEnd
)
||
(
!
hourFormat
&&
task
.
infoForCell
.
endMinute
===
59
&&
task
.
infoForCell
.
endHour
===
hour
))
{
if
(
isNaN
(
line
[
a
]))
{
if
(
isNaN
(
line
[
a
]))
{
havePlace
=
false
havePlace
=
false
break
;
break
;
...
@@ -77,7 +77,7 @@ const CalendarRowDay = ({xs, hoursInDay, createTaskInCellHandler, currentTask, h
...
@@ -77,7 +77,7 @@ const CalendarRowDay = ({xs, hoursInDay, createTaskInCellHandler, currentTask, h
break
;
break
;
}
}
line
[
i
]
+=
`-
${
k
}
`
line
[
i
]
+=
`-
${
k
}
`
if
(
task
.
infoForCell
.
endMinute
===
59
&&
task
.
infoForCell
.
endHour
===
hour
+
hourDiffEnd
||
(
!
hourFormat
&&
task
.
infoForCell
.
endMinute
===
59
&&
task
.
infoForCell
.
endHour
===
hour
))
{
if
(
(
task
.
infoForCell
.
endMinute
===
59
&&
task
.
infoForCell
.
endHour
===
hour
+
hourDiffEnd
)
||
(
!
hourFormat
&&
task
.
infoForCell
.
endMinute
===
59
&&
task
.
infoForCell
.
endHour
===
hour
))
{
skipLine
=
true
skipLine
=
true
break
;
break
;
}
}
...
@@ -93,7 +93,7 @@ const CalendarRowDay = ({xs, hoursInDay, createTaskInCellHandler, currentTask, h
...
@@ -93,7 +93,7 @@ const CalendarRowDay = ({xs, hoursInDay, createTaskInCellHandler, currentTask, h
}
}
}
}
return
lines
return
lines
},
[
sortedTasks
,
hour
s
])
},
[
availableTasks
.
length
,
hourFormat
,
hours
,
hoursInDay
,
sortedTask
s
])
return
<>
return
<>
<
Grid
<
Grid
...
@@ -112,7 +112,7 @@ const CalendarRowDay = ({xs, hoursInDay, createTaskInCellHandler, currentTask, h
...
@@ -112,7 +112,7 @@ const CalendarRowDay = ({xs, hoursInDay, createTaskInCellHandler, currentTask, h
return
(
return
(
<
CalendarStandartCell
<
CalendarStandartCell
key
=
{
i
}
key
=
{
i
}
item
xs
=
{
12
/
hoursInDay
.
length
}
item
xs
=
{
xs
}
createTaskInCellHandler
=
{
createTaskInCellHandler
}
createTaskInCellHandler
=
{
createTaskInCellHandler
}
hours
=
{
hour
}
hours
=
{
hour
}
dayNumber
=
{
day
.
dayNumber
}
dayNumber
=
{
day
.
dayNumber
}
...
...
planner-front/src/components/MonthCalendarBody/CalendarStandartCell.js/CalendarStandartCell.js
View file @
72e00819
import
{
Grid
,
TextField
,
Typography
}
from
"@mui/material"
;
import
{
Grid
}
from
"@mui/material"
;
import
{
memo
,
useEffect
,
useState
}
from
"react"
;
import
{
memo
,
useEffect
,
useState
}
from
"react"
;
const
CalendarStandartCell
=
({
children
,
xs
,
hours
,
dayNumber
,
createTaskInCellHandler
,
handleOpen
,
modal
})
=>
{
const
CalendarStandartCell
=
({
children
,
xs
,
hours
,
dayNumber
,
createTaskInCellHandler
,
handleOpen
,
modal
})
=>
{
...
...
planner-front/src/components/MonthCalendarBody/CalendarTask/CalendarTask.js
View file @
72e00819
import
{
Grid
,
TextField
,
Typography
}
from
"@mui/material"
;
import
{
Grid
}
from
"@mui/material"
;
import
React
,
{
memo
,
useState
,
useEffect
,
useMemo
}
from
"react"
;
import
React
,
{
memo
}
from
"react"
;
import
{
useDispatch
}
from
"react-redux"
;
import
{
editCalendarTask
}
from
"../../../store/actions/tasksActions"
;
const
TaskDefault
=
({
task
,
onClickTaskHandler
})
=>
{
const
TaskDefault
=
({
task
,
onClickTaskHandler
})
=>
{
...
@@ -25,7 +23,7 @@ const TaskWithNoStartAndAllEnd = ({task, onClickTaskHandler}) => {
...
@@ -25,7 +23,7 @@ const TaskWithNoStartAndAllEnd = ({task, onClickTaskHandler}) => {
<
/span
>
<
/span
>
<
/Grid>
)
<
/Grid>
)
}
}
const
TaskWithAllStartAndNoEnd
=
({
task
,
onClickTaskHandler
})
=>
{
const
TaskWithAllStartAndNoEnd
=
({
onClickTaskHandler
})
=>
{
return
(
<
Grid
return
(
<
Grid
sx
=
{{
height
:
'30px'
,
backgroundColor
:
'lightgreen'
,
whiteSpace
:
'nowrap'
,
overflow
:
'hidden'
,
textOverflow
:
'ellipsis'
,
padding
:
'5px'
,
borderBottom
:
'1px solid rgb(29, 161, 51)'
,
borderTopRightRadius
:
'10px'
,
borderBottomRightRadius
:
'10px'
,
margin
:
"5px 10px 5px -1px"
}}
sx
=
{{
height
:
'30px'
,
backgroundColor
:
'lightgreen'
,
whiteSpace
:
'nowrap'
,
overflow
:
'hidden'
,
textOverflow
:
'ellipsis'
,
padding
:
'5px'
,
borderBottom
:
'1px solid rgb(29, 161, 51)'
,
borderTopRightRadius
:
'10px'
,
borderBottomRightRadius
:
'10px'
,
margin
:
"5px 10px 5px -1px"
}}
onClick
=
{
onClickTaskHandler
}
onClick
=
{
onClickTaskHandler
}
...
@@ -35,7 +33,7 @@ const TaskWithAllStartAndNoEnd = ({task, onClickTaskHandler}) => {
...
@@ -35,7 +33,7 @@ const TaskWithAllStartAndNoEnd = ({task, onClickTaskHandler}) => {
<
/span
>
<
/span
>
<
/Grid>
)
<
/Grid>
)
}
}
const
TaskWithAllStartAndAllEnd
=
({
task
,
onClickTaskHandler
})
=>
{
const
TaskWithAllStartAndAllEnd
=
({
onClickTaskHandler
})
=>
{
return
(
<
Grid
return
(
<
Grid
sx
=
{{
height
:
'30px'
,
backgroundColor
:
'lightgreen'
,
whiteSpace
:
'nowrap'
,
overflow
:
'hidden'
,
textOverflow
:
'ellipsis'
,
padding
:
'5px'
,
borderBottom
:
'1px solid rgb(29, 161, 51)'
,
margin
:
"5px -1px"
}}
sx
=
{{
height
:
'30px'
,
backgroundColor
:
'lightgreen'
,
whiteSpace
:
'nowrap'
,
overflow
:
'hidden'
,
textOverflow
:
'ellipsis'
,
padding
:
'5px'
,
borderBottom
:
'1px solid rgb(29, 161, 51)'
,
margin
:
"5px -1px"
}}
onClick
=
{
onClickTaskHandler
}
onClick
=
{
onClickTaskHandler
}
...
@@ -46,7 +44,7 @@ const TaskWithAllStartAndAllEnd = ({task, onClickTaskHandler}) => {
...
@@ -46,7 +44,7 @@ const TaskWithAllStartAndAllEnd = ({task, onClickTaskHandler}) => {
<
/Grid>
)
<
/Grid>
)
}
}
const
Empty
=
(
{}
)
=>
{
const
Empty
=
()
=>
{
return
(
<
Grid
return
(
<
Grid
sx
=
{{
height
:
'30px'
,
backgroundColor
:
'rgb(0,0,0,0)'
,
whiteSpace
:
'nowrap'
,
overflow
:
'hidden'
,
textOverflow
:
'ellipsis'
,
padding
:
'5px'
,
margin
:
"5px -1px"
}}
sx
=
{{
height
:
'30px'
,
backgroundColor
:
'rgb(0,0,0,0)'
,
whiteSpace
:
'nowrap'
,
overflow
:
'hidden'
,
textOverflow
:
'ellipsis'
,
padding
:
'5px'
,
margin
:
"5px -1px"
}}
>
>
...
@@ -61,16 +59,8 @@ const Empty = ({}) => {
...
@@ -61,16 +59,8 @@ const Empty = ({}) => {
const
CalendarTask
=
({
hours
,
setCurrentTask
,
hourFormat
,
handleOpen
,
currentTask
,
linesForCell
,
sortedTasks
})
=>
{
const
CalendarTask
=
({
hours
,
setCurrentTask
,
hourFormat
,
handleOpen
,
currentTask
,
linesForCell
,
sortedTasks
})
=>
{
const
[
thisCellCurrentTask
,
setThisCellCurrentTask
]
=
useState
({})
const
hour
=
parseInt
(
hours
.
split
(
':'
)[
0
])
const
hour
=
parseInt
(
hours
.
split
(
':'
)[
0
])
useEffect
(()
=>
{
if
(
!
currentTask
.
title
)
{
setThisCellCurrentTask
({})
}
},
[
currentTask
])
const
onClickTaskHandler
=
(
e
,
task
)
=>
{
const
onClickTaskHandler
=
(
e
,
task
)
=>
{
e
.
stopPropagation
();
e
.
stopPropagation
();
setCurrentTask
(
task
);
setCurrentTask
(
task
);
...
@@ -95,7 +85,6 @@ const CalendarTask = ({hours, setCurrentTask, hourFormat, handleOpen, currentTas
...
@@ -95,7 +85,6 @@ const CalendarTask = ({hours, setCurrentTask, hourFormat, handleOpen, currentTas
||
(
!
hourFormat
&&
task
.
infoForCell
.
startHour
<
hour
&&
task
.
infoForCell
.
endHour
>
hour
+
1
))
{
||
(
!
hourFormat
&&
task
.
infoForCell
.
startHour
<
hour
&&
task
.
infoForCell
.
endHour
>
hour
+
1
))
{
return
(
<
TaskWithAllStartAndAllEnd
return
(
<
TaskWithAllStartAndAllEnd
key
=
{
task
.
id
}
key
=
{
task
.
id
}
task
=
{
task
}
onClickTaskHandler
=
{(
e
)
=>
{
onClickTaskHandler
(
e
,
task
)}}
onClickTaskHandler
=
{(
e
)
=>
{
onClickTaskHandler
(
e
,
task
)}}
/>
)
/>
)
}
}
...
@@ -103,7 +92,6 @@ const CalendarTask = ({hours, setCurrentTask, hourFormat, handleOpen, currentTas
...
@@ -103,7 +92,6 @@ const CalendarTask = ({hours, setCurrentTask, hourFormat, handleOpen, currentTas
return
(
return
(
<
TaskWithAllStartAndNoEnd
<
TaskWithAllStartAndNoEnd
key
=
{
task
.
id
}
key
=
{
task
.
id
}
task
=
{
task
}
onClickTaskHandler
=
{(
e
)
=>
{
onClickTaskHandler
(
e
,
task
)}}
onClickTaskHandler
=
{(
e
)
=>
{
onClickTaskHandler
(
e
,
task
)}}
/>
)
/>
)
}
}
...
...
planner-front/src/components/MonthCalendarBody/MonthCalendarBody.js
View file @
72e00819
import
{
FormControlLabel
,
Switch
}
from
"@mui/material"
;
import
{
FormControlLabel
,
Switch
}
from
"@mui/material"
;
import
{
memo
,
useEffect
,
useState
}
from
"react"
;
import
{
useState
}
from
"react"
;
import
CalendarRow
from
"./CalendarRow/CalendarRow"
;
import
CalendarRow
from
"./CalendarRow/CalendarRow"
;
import
CalendarSmallCell
from
"./CalendarSmallCell/CalendarSmallCell"
;
import
CalendarSmallCell
from
"./CalendarSmallCell/CalendarSmallCell"
;
import
CalendarStandartCell
from
"./CalendarStandartCell.js/CalendarStandartCell"
;
import
CalendarStandartCell
from
"./CalendarStandartCell.js/CalendarStandartCell"
;
import
CalendarTask
from
"./CalendarTask/CalendarTask"
;
import
ModalTask
from
"../UI/ModalTask/ModalTask"
;
import
ModalTask
from
"../UI/ModalTask/ModalTask"
;
import
MonthCalendarModalContent
from
"../MonthCalendarModalContent/MonthCalendarModalContent"
;
import
MonthCalendarModalContent
from
"../MonthCalendarModalContent/MonthCalendarModalContent"
;
import
CalendarRowDay
from
"./CalendarRowDay/CalendarRowDay"
;
import
CalendarRowDay
from
"./CalendarRowDay/CalendarRowDay"
;
...
@@ -11,7 +10,6 @@ import CalendarRowDay from "./CalendarRowDay/CalendarRowDay";
...
@@ -11,7 +10,6 @@ import CalendarRowDay from "./CalendarRowDay/CalendarRowDay";
function
MonthCalendarBody
({
month
,
year
,
tasks
,
createTaskInCellHandler
,
currentTask
,
setCurrentTask
,
hourFormat
,
setHourFormat
,
onChangeCurrentTaskHandler
,
sendNewTaskHandler
,
deleteTaskHandler
,
cellSizes
,
hoursInDay
,
daysInMonth
})
{
function
MonthCalendarBody
({
month
,
year
,
tasks
,
createTaskInCellHandler
,
currentTask
,
setCurrentTask
,
hourFormat
,
setHourFormat
,
onChangeCurrentTaskHandler
,
sendNewTaskHandler
,
deleteTaskHandler
,
cellSizes
,
hoursInDay
,
daysInMonth
})
{
const
[
modal
,
setModal
]
=
useState
({
open
:
false
,
y
:
0
,
x
:
0
,});
const
[
modal
,
setModal
]
=
useState
({
open
:
false
,
y
:
0
,
x
:
0
,});
const
[
allCellsTasks
,
setAllCellsTasks
]
=
useState
([])
const
handleOpen
=
(
e
)
=>
{
const
handleOpen
=
(
e
)
=>
{
setModal
(
{
setModal
(
{
open
:
true
,
open
:
true
,
...
@@ -56,7 +54,7 @@ function MonthCalendarBody({month, year, tasks, createTaskInCellHandler, current
...
@@ -56,7 +54,7 @@ function MonthCalendarBody({month, year, tasks, createTaskInCellHandler, current
<
CalendarSmallCell
xs
=
{
cellSizes
.
smallCell
}
>
{
day
.
dayNumber
}
<
/CalendarSmallCell
>
<
CalendarSmallCell
xs
=
{
cellSizes
.
smallCell
}
>
{
day
.
dayNumber
}
<
/CalendarSmallCell
>
<
CalendarSmallCell
xs
=
{
cellSizes
.
smallCell
}
>
{
day
.
dayOfWeek
}
<
/CalendarSmallCell
>
<
CalendarSmallCell
xs
=
{
cellSizes
.
smallCell
}
>
{
day
.
dayOfWeek
}
<
/CalendarSmallCell
>
<
CalendarRowDay
<
CalendarRowDay
xs
=
{
cellSizes
.
standar
Cell
}
xs
=
{
cellSizes
.
day
Cell
}
createTaskInCellHandler
=
{
createTaskInCellHandler
}
createTaskInCellHandler
=
{
createTaskInCellHandler
}
hoursInDay
=
{
hoursInDay
}
hoursInDay
=
{
hoursInDay
}
currentTask
=
{
currentTask
}
currentTask
=
{
currentTask
}
...
...
planner-front/src/components/UI/СustomSelect/СustomSelect.js
View file @
72e00819
...
@@ -6,10 +6,10 @@ function СustomSelect({value, onChange, label, variant='standard', items, id})
...
@@ -6,10 +6,10 @@ function СustomSelect({value, onChange, label, variant='standard', items, id})
return
(
return
(
<>
<>
<
FormControl
variant
=
{
variant
}
sx
=
{{
m
:
1
,
minWidth
:
120
}}
>
<
FormControl
variant
=
{
variant
}
sx
=
{{
m
:
1
,
minWidth
:
120
}}
>
<
InputLabel
id
=
{
id
+
'-select'
+
'-label'
}
>
{
label
}
<
/InputLabel
>
<
InputLabel
id
=
{
`
${
id
}
-select-label`
}
>
{
label
}
<
/InputLabel
>
<
Select
<
Select
labelId
=
{
id
+
'-select'
+
'-label'
}
labelId
=
{
`
${
id
}
-select-label`
}
id
=
{
id
+
'-select'
}
id
=
{
`
${
id
}
-select`
}
value
=
{
value
}
value
=
{
value
}
onChange
=
{
onChange
}
onChange
=
{
onChange
}
label
=
{
label
}
label
=
{
label
}
...
...
planner-front/src/containers/MonthCalendar/MonthCalendar.js
View file @
72e00819
...
@@ -30,7 +30,7 @@ function MonthCalendar() {
...
@@ -30,7 +30,7 @@ function MonthCalendar() {
const
cells
=
arr
.
length
const
cells
=
arr
.
length
const
xs
=
10.8
/
cells
const
xs
=
10.8
/
cells
setCellSizes
(()
=>
{
setCellSizes
(()
=>
{
return
{
smallCell
:
0.6
,
standarCell
:
xs
}
return
{
smallCell
:
0.6
,
standarCell
:
xs
,
dayCell
:
12
/
cells
}
})
})
return
arr
return
arr
}
else
{
}
else
{
...
@@ -38,7 +38,7 @@ function MonthCalendar() {
...
@@ -38,7 +38,7 @@ function MonthCalendar() {
const
cells
=
arr
.
length
const
cells
=
arr
.
length
const
xs
=
10.8
/
cells
const
xs
=
10.8
/
cells
setCellSizes
(()
=>
{
setCellSizes
(()
=>
{
return
{
smallCell
:
0.6
,
standarCell
:
xs
}
return
{
smallCell
:
0.6
,
standarCell
:
xs
,
dayCell
:
12
/
cells
}
})
})
return
arr
return
arr
}
}
...
...
planner-front/src/store/actions/tasksActions.js
View file @
72e00819
...
@@ -69,7 +69,7 @@ const addTaskFailure = (error) => {
...
@@ -69,7 +69,7 @@ const addTaskFailure = (error) => {
export
const
addTask
=
(
task
)
=>
{
export
const
addTask
=
(
task
)
=>
{
return
async
(
dispatch
,
getState
)
=>
{
return
async
(
dispatch
,
getState
)
=>
{
dispatch
(
addTaskRequest
());
dispatch
(
addTaskRequest
());
const
token
=
getState
().
users
?.
user
?.
token
;
//
const token = getState().users?.user?.token;
try
{
try
{
await
axios
.
post
(
"/tasks"
,
task
);
await
axios
.
post
(
"/tasks"
,
task
);
dispatch
(
addTaskSuccess
())
dispatch
(
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