Commit 33d73756 authored by PDuarte's avatar PDuarte

menupages basic crud

parent 2de45044
...@@ -24,19 +24,14 @@ const Tables = () => { ...@@ -24,19 +24,14 @@ const Tables = () => {
const onSubmitHandler = values => { const onSubmitHandler = values => {
dispatch( dispatch(
addmenupages({ addmenupages({
name: values.name, idproject: values.idproject,
slug: values.slug, system_name: values.system_name,
view_all: values.view_all, last_seen: values.last_seen,
search: values.search, layout_page_id: values.layout_page_id,
seasons_carousel: values.seasons_carousel, type: values.type,
episodes_carousel: values.episodes_carousel, display: values.display,
related_movies: values.related_movies, pagetypeid: values.pagetypeid,
related_series: values.related_series, order: values.order
player_related: values.player_related,
live_TV: values.live_TV,
my_stuff: values.my_stuff,
pages: values.pages,
platforms: values.platforms
}) })
) )
...@@ -59,9 +54,14 @@ const Tables = () => { ...@@ -59,9 +54,14 @@ const Tables = () => {
<div className="card-body"> <div className="card-body">
<ElementCard selectedElement={{ <ElementCard selectedElement={{
id: '<generate>', id: '<generate>',
name: '', idproject: '2',
slug: '', system_name: '',
platforms: [] last_seen: '',
layout_page_id: '',
type: '',
display: '',
pagetypeid: '',
order: '0'
}} }}
onSubmitHandler={onSubmitHandler} onSubmitHandler={onSubmitHandler}
/> />
......
This diff is collapsed.
...@@ -21,23 +21,18 @@ const ElementEdit = () => { ...@@ -21,23 +21,18 @@ const ElementEdit = () => {
{ id } = useParams() { id } = useParams()
const onSubmitHandler = values => { const onSubmitHandler = values => {
console.log(values)
dispatch( dispatch(
updatemenupages({ updatemenupages({
...dataElement, ...dataElement,
id: values.id, idproject: values.idproject,
name: values.name, system_name: values.system_name,
slug: values.slug, last_seen: values.last_seen,
platforms: values.platforms, layout_page_id: values.layout_page_id,
view_all: values.view_all, type: values.type,
search: values.search, display: values.display,
seasons_carousel: values.seasons_carousel, pagetypeid: values.pagetypeid,
episodes_carousel: values.episodes_carousel, order: values.order
related_movies: values.related_movies,
related_series: values.related_series,
player_related: values.player_related,
live_TV: values.live_TV,
my_stuff: values.my_stuff,
pages: values.pages
}) })
) )
......
...@@ -31,10 +31,8 @@ export const getData_menupages = params => { ...@@ -31,10 +31,8 @@ export const getData_menupages = params => {
export const addmenupages = params => { export const addmenupages = params => {
return (dispatch, getState) => { return (dispatch, getState) => {
const newparam = addProject(params)
console.log(newparams)
axios axios
.post(`${process.env.REACT_APP_API}${moduleSettings.apiBaseURL}`, newparams) .post(`${process.env.REACT_APP_API}${moduleSettings.apiBaseURL}`, params)
.then(response => { .then(response => {
dispatch({ dispatch({
type: 'ADD_MENUPAGE', type: 'ADD_MENUPAGE',
......
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