From 8abd3ccd48c6d3b1c46f92a28e431385cca3e656 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 10 Mar 2021 17:02:30 +0100 Subject: venue form. add project ID to venue --- .../app/views/venue/components/venue.form.js | 5 ++-- .../app/views/venue/components/venue.menu.js | 29 ++++++---------------- 2 files changed, 10 insertions(+), 24 deletions(-) (limited to 'animism-align/frontend/app/views/venue/components') diff --git a/animism-align/frontend/app/views/venue/components/venue.form.js b/animism-align/frontend/app/views/venue/components/venue.form.js index b1a124f..7ffa098 100644 --- a/animism-align/frontend/app/views/venue/components/venue.form.js +++ b/animism-align/frontend/app/views/venue/components/venue.form.js @@ -111,8 +111,8 @@ export default class VenueForm extends Component { } const { isNew, onSubmit } = this.props const { data } = this.state - const requiredKeys = "title date".split(" ") - const validKeys = "title date settings".split(" ") + const requiredKeys = "project_id title date".split(" ") + const validKeys = "project_id title date settings".split(" ") const validData = validKeys.reduce((a,b) => { a[b] = data[b]; return a }, {}) const errorFields = requiredKeys.filter(key => !validData[key]) if (errorFields.length) { @@ -132,7 +132,6 @@ export default class VenueForm extends Component { render() { const { isNew } = this.props const { title, submitTitle, errorFields, data } = this.state - // console.log(data) return (

{title}

diff --git a/animism-align/frontend/app/views/venue/components/venue.menu.js b/animism-align/frontend/app/views/venue/components/venue.menu.js index 1e1a7cd..c76edf6 100644 --- a/animism-align/frontend/app/views/venue/components/venue.menu.js +++ b/animism-align/frontend/app/views/venue/components/venue.menu.js @@ -14,43 +14,30 @@ export default class VenueMenu extends Component { render() { return (
- - - + +
) } } -const VenueIndexMenu = () => ([ - , +const VenueIndexMenu = (props) => ([ + , + , ]) -const VenueShowMenu = connect(mapStateToProps)((props) => ([ - , - , - { - const { res: venue } = props.venue.show - if (confirm("Really delete this venue?")) { - actions.venue.destroy(venue).then(() => { - history.push('/venue/') - }) - } - }} />, -])) - const VenueNewMenu = (props) => ([ - , + , ]) const VenueEditMenu = connect(mapStateToProps)((props) => ([ - , + , { const { res: venue } = props.venue.show if (confirm("Really delete this venue?")) { actions.venue.destroy(venue).then(() => { - history.push('/venue/') + history.push(`/project/${props.match.params.project_id}/venues/`) }) } }} />, -- cgit v1.2.3-70-g09d2