Commit f6fb01d3 authored by PDuarte's avatar PDuarte

episodes UI series hamdle

parent dba9a687
......@@ -118,6 +118,16 @@ const handleError = (text) => {
}
setElementData(newData)
},
handleSeriesChange = (value) => {
dispatch(getData_seasons({
start: 0,
length: 1000,
idproject: selectedElement.projectid,
idseries: value,
q: null
}))
},
updateGenres = (value) => {
const newValue = value.map(elm => {
return {
......@@ -270,6 +280,13 @@ const handleError = (text) => {
idproject: selectedElement.projectid,
q: null
}))
dispatch(getData_seasons({
start: 0,
length: 1000,
idproject: selectedElement.projectid,
idseries: selectedElement.seriesID,
q: null
}))
}, [settingStore.selectedProject])
......@@ -282,12 +299,12 @@ const handleError = (text) => {
q: null
}))
}
if (dataElement !== null && dataElement.seriesid !== null && (!projectAssets.allDataSeasons || projectAssets.allDataSeasons.length < 1)) {
if (dataElement !== null && dataElement.seriesID !== null && (!projectAssets.allDataSeasons || projectAssets.allDataSeasons.length < 1)) {
dispatch(getData_seasons({
start: 0,
length: 1000,
length: 1001,
idproject: dataElement.idproject,
seriesid: dataElement.seriesid,
seriesid: dataElement.seriesID,
q: null
}))
}
......@@ -397,6 +414,7 @@ return (
placeholder='seriesid'
defaultValue={dataElement && dataElement.seriesid}
className={classnames({ 'is-invalid': errors['seriesid'] })}
onChange={e => handleSeriesChange(e.target.value)}
>
{!!projectAssets.allDataSeries && !!dataElement ? projectAssets.allDataSeries.map(option => {
return <option key={option.id}
......
// ** React Imports
import { Link } from 'react-router-dom'
import { cleanasset } from '../store/actions'
import { cleanepisode } from '../store/actions'
import { store } from '@store/storeConfig/store'
// ** Custom Components
......@@ -228,7 +228,7 @@ export const serverSideColumns = [
<Link
to={`${moduleSettings.baseURL}/edit/${row.id}`}
className='user-name text-truncate mb-0'
onClick={() => store.dispatch(cleanasset(row.id))}
onClick={() => store.dispatch(cleanepisode(row.id))}
>
<span className='font-weight-bold'>{row.title}</span>
</Link>
......
......@@ -30,8 +30,8 @@ const ElementEdit = () => {
...dataElement,
idproject: values.idproject,
title: values.title,
seriesid: values.seriesid,
seasonid: values.seasonid,
seriesID: values.seriesid,
seasonID: values.seasonid,
parentid: values.parentid,
parenttype: values.parenttype,
external_id: values.external_id,
......
......@@ -75,6 +75,15 @@ export const getData_episodes = params => {
}
}
export const cleanepisode = id => {
return async dispatch => {
dispatch({
type: 'GET_EPISODE',
data: null
})
}
}
export const addepisode = params => {
return (dispatch, getState) => {
axios
......
......@@ -22,10 +22,12 @@ const _getData_seasons = params => {
export const getData_seasons = params => {
if (!!params.idproject && params.idproject !== null) {
const newparams = {
...params,
type: 'Seasons'
}
console.log(newparams, params)
return _getData_seasons(newparams)
}
......
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