Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
C
cms
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
Pedro-dev_2
cms
Commits
03b85e8e
Commit
03b85e8e
authored
Jul 18, 2021
by
PDuarte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete fixs season, episodes
parent
b250bfe9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
6 deletions
+47
-6
main.js
src/views/assets/episodes/edit/main.js
+2
-2
main.js
src/views/assets/seasons/edit/main.js
+2
-2
episodes.js
src/views/assets/store/actions/episodes.js
+22
-1
seasons.js
src/views/assets/store/actions/seasons.js
+21
-1
No files found.
src/views/assets/episodes/edit/main.js
View file @
03b85e8e
...
@@ -2,7 +2,7 @@ import { useState, useEffect, Fragment } from 'react'
...
@@ -2,7 +2,7 @@ import { useState, useEffect, Fragment } from 'react'
import
{
useParams
,
Link
}
from
'react-router-dom'
import
{
useParams
,
Link
}
from
'react-router-dom'
// ** Store & Actions
// ** Store & Actions
import
{
getepisode
,
updateepisodes
,
delete
asset
}
from
'../../store/actions'
import
{
getepisode
,
updateepisodes
,
delete
episode
}
from
'../../store/actions'
import
{
useSelector
,
useDispatch
}
from
'react-redux'
import
{
useSelector
,
useDispatch
}
from
'react-redux'
...
@@ -47,7 +47,7 @@ const ElementEdit = () => {
...
@@ -47,7 +47,7 @@ const ElementEdit = () => {
const
handelDelete
=
()
=>
{
const
handelDelete
=
()
=>
{
if
(
!
confirm
(
'Delete'
))
return
if
(
!
confirm
(
'Delete'
))
return
dispatch
(
dispatch
(
delete
asset
({
...
dataElement
})
delete
episode
({
...
dataElement
})
)
)
}
}
// ** Function to get user on mount
// ** Function to get user on mount
...
...
src/views/assets/seasons/edit/main.js
View file @
03b85e8e
...
@@ -2,7 +2,7 @@ import { useState, useEffect, Fragment } from 'react'
...
@@ -2,7 +2,7 @@ import { useState, useEffect, Fragment } from 'react'
import
{
useParams
,
Link
}
from
'react-router-dom'
import
{
useParams
,
Link
}
from
'react-router-dom'
// ** Store & Actions
// ** Store & Actions
import
{
getseason
,
updateseasons
,
delete
asset
}
from
'../../store/actions'
import
{
getseason
,
updateseasons
,
delete
season
}
from
'../../store/actions'
import
{
useSelector
,
useDispatch
}
from
'react-redux'
import
{
useSelector
,
useDispatch
}
from
'react-redux'
...
@@ -47,7 +47,7 @@ const ElementEdit = () => {
...
@@ -47,7 +47,7 @@ const ElementEdit = () => {
const
handelDelete
=
()
=>
{
const
handelDelete
=
()
=>
{
if
(
!
confirm
(
'Delete'
))
return
if
(
!
confirm
(
'Delete'
))
return
dispatch
(
dispatch
(
delete
asset
({
...
dataElement
})
delete
season
({
...
dataElement
})
)
)
}
}
// ** Function to get user on mount
// ** Function to get user on mount
...
...
src/views/assets/store/actions/episodes.js
View file @
03b85e8e
...
@@ -104,4 +104,25 @@ export const getData_episodes = params => {
...
@@ -104,4 +104,25 @@ export const getData_episodes = params => {
})
})
}
}
}
}
\ No newline at end of file
export
const
deleteepisode
=
params
=>
{
return
(
dispatch
,
getState
)
=>
{
axios
.
delete
(
`
${
process
.
env
.
REACT_APP_API
}${
moduleSettings
.
apiBaseURL
}
/
${
params
.
id
}
`
,
params
)
.
then
(
response
=>
{
dispatch
({
type
:
'GET_EPISODE'
,
data
:
null
})
})
.
then
(()
=>
{
dispatch
(
setSaveSatus
(
true
))
})
.
catch
(
err
=>
{
const
errosMsg
=
!
err
.
response
?
'error'
:
err
.
response
.
data
.
message
console
.
log
(
errosMsg
)
dispatch
(
setErrorMsg
(
errosMsg
))
})
}
}
\ No newline at end of file
src/views/assets/store/actions/seasons.js
View file @
03b85e8e
...
@@ -105,4 +105,24 @@ export const getData_seasons = params => {
...
@@ -105,4 +105,24 @@ export const getData_seasons = params => {
})
})
}
}
}
}
\ No newline at end of file
export
const
deleteseason
=
params
=>
{
return
(
dispatch
,
getState
)
=>
{
axios
.
delete
(
`
${
process
.
env
.
REACT_APP_API
}${
moduleSettings
.
apiBaseURL
}
/
${
params
.
id
}
`
,
params
)
.
then
(
response
=>
{
dispatch
({
type
:
'GET_SEASON'
,
data
:
null
})
})
.
then
(()
=>
{
dispatch
(
setSaveSatus
(
true
))
})
.
catch
(
err
=>
{
const
errosMsg
=
!
err
.
response
?
'error'
:
err
.
response
.
data
.
message
console
.
log
(
errosMsg
)
dispatch
(
setErrorMsg
(
errosMsg
))
})
}
}
\ No newline at end of file
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