Commit 33d73756 authored by PDuarte's avatar PDuarte

menupages basic crud

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