Commit 64c86bf0 authored by PDuarte's avatar PDuarte

movies refactory

parent 1b4cec82
......@@ -8,7 +8,7 @@ export default [
children: [
{
id: 'assetsDash',
title: 'Project Assets',
title: 'Project Movies',
icon: <Briefcase />,
navLink: '/assets/projectassets'
},
......
......@@ -43,7 +43,7 @@ const Tables = () => {
return (
<Fragment>
<Breadcrumbs breadCrumbTitle='Assets' breadCrumbParent='Assets' breadCrumbActive={moduleSettings.mainTitle} />
<Breadcrumbs breadCrumbTitle='Movies' breadCrumbParent='Movies' breadCrumbActive={moduleSettings.mainTitle} />
<Row>
<Col sm='12'>
<Link to={moduleSettings.baseURL}>Back to {moduleSettings.mainTitle}</Link>
......
......@@ -330,7 +330,8 @@ return (
<Col md='4' sm='12'>
<FormGroup>
<Label for='parenttype'>Parent Type</Label>
<Input
<Input
readOnly={true}
type='text'
name='parenttype'
id='parenttype'
......@@ -345,6 +346,7 @@ return (
<FormGroup>
<Label for='parentid'>Parent Id</Label>
<Input
readOnly={true}
type='text'
name='parentid'
id='parentid'
......
......@@ -18,7 +18,7 @@ import moduleSettings from '../module'
const Tables = () => {
return (
<Fragment>
<Breadcrumbs breadCrumbTitle='Assets' breadCrumbParent='Assets' breadCrumbActive={moduleSettings.mainTitle} />
<Breadcrumbs breadCrumbTitle='Movies' breadCrumbParent='Movies' breadCrumbActive={moduleSettings.mainTitle} />
<Row>
<Col sm='12'>
<Link to={moduleSettings.baseURL}>Back to {moduleSettings.mainTitleSingle}</Link>
......
......@@ -17,7 +17,7 @@ import moduleSettings from './module'
const Tables = () => {
return (
<Fragment>
<Breadcrumbs breadCrumbTitle='Assets' breadCrumbParent='Assets' breadCrumbActive={moduleSettings.mainTitle} />
<Breadcrumbs breadCrumbTitle='Movies' breadCrumbParent='Movies' breadCrumbActive={moduleSettings.mainTitle} />
<Row>
<Col sm='12'>
<DataTable />
......
const moduleSettings = {
mainTitle: 'Assets',
mainTitleSingle: 'Asset',
mainTitle: 'Movies',
mainTitleSingle: 'Movie',
apiBaseURL: '/api/assets',
baseURL: '/assets/projectassets',
newElement: {
......
......@@ -3,7 +3,7 @@ import { Fragment, useState, useEffect, memo } from 'react'
// ** Table Columns
import { serverSideColumns } from './data'
// ** Store & Actions
import { getData_assets} from '../store/actions'
import { getData_movies} from '../store/actions'
import { useSelector, useDispatch } from 'react-redux'
import DataTableServerSide from '@components/datatable'
......@@ -16,7 +16,7 @@ const DataTable = () => {
const storeNavbar = useSelector(state => state.navbar)
useEffect(() => {
dispatch(getData_assets({
dispatch(getData_movies({
start: 0,
length: 1000
}))
......@@ -26,11 +26,11 @@ const DataTable = () => {
return (
<DataTableServerSide
cardTitle={moduleSettings.mainTitle}
allData={store.allDataAssets}
getData={getData_assets}
allData={store.allDataMovies}
getData={getData_movies}
serverSideColumns={serverSideColumns}
linkAddButton={`${moduleSettings.baseURL}/add`}
total={store.totalAssets}
total={store.totalMovies}
/>
)
......
export * from './assets'
export * from './movies'
export * from './lives'
export * from './series'
export * from './seasons'
......
import {store} from '@store/storeConfig/store'
import axios from 'axios'
import moduleSettings from '../../projectassets/module'
const _getData_movies = params => {
return async dispatch => {
await axios.get(`${process.env.REACT_APP_API}${moduleSettings.apiBaseURL}`, {params}
).then(response => {
dispatch({
type: 'GET_DATA_MOVIES',
allData: response.data.data,
// datalayoumenus: response.data.invoices,
totalPages: response.data.recordsTotal,
params: response.data.params
})
})
}
}
export const getData_movies = params => {
if (!!params.idproject && params.idproject !== null) {
const newparams = {
...params,
type: 'Movies'
}
return _getData_movies(newparams)
}
const currentProject = store.getState().navbar.projectCurrent
const newparams = {
...params,
idproject: !currentProject ? '%' : currentProject.value,
type: 'Movies'
}
return _getData_movies(newparams)
}
......@@ -19,6 +19,12 @@ const initialState = {
allDataLives: [],
selectedLive: null,
dataMovies: [],
totalMovies: 1,
paramsMovies: {},
allDataMovies: [],
selectedMovies: null,
dataSeries: [],
totalSeries: 1,
paramsSeries: {},
......@@ -73,8 +79,17 @@ const assets = (state = initialState, action) => {
return { ...state }
case 'ADD_ASSET':
return { ...state }
return { ...state }
// Movie
case 'GET_DATA_MOVIES':
return {
...state,
allDataMovies: action.allData,
dataMovies: action.data,
totalMovies: action.totalPages,
paramsMovies: action.params
}
// serie
case 'GET_DATA_SERIES':
return {
......
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