Changeset 0f5aa27 for frontend/src/Components/Forms
- Timestamp:
- 02/04/24 16:57:49 (10 months ago)
- Branches:
- master
- Children:
- efaa053
- Parents:
- 07f4e8b
- Location:
- frontend/src/Components/Forms
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
frontend/src/Components/Forms/AddItemMenuForm.js
r07f4e8b r0f5aa27 4 4 import useFormData from "../Hooks/useFormData"; 5 5 import useCreateMenu from "../Hooks/Restaurant/useCreateMenu" 6 import useCreate from "../Hooks/useCreate"; 6 7 7 8 const AddItemMenuForm = (props) => { … … 9 10 10 11 const edit = props.menu 12 console.log(props.menu) 11 13 const dummy = { 12 14 name: "", … … 23 25 edit ? props.menu : dummy 24 26 ); 27 const { createEntity } = useCreate(); 25 28 26 29 return ( … … 72 75 onClick={(e) => { 73 76 e.preventDefault(); 74 createMenu(props.Id, formData) 75 props.refresh((prevState) => { 76 return prevState + 1; 77 }) 77 if(!edit) { 78 createMenu(props.Id, formData, props.refresh) 79 } 80 else { 81 createEntity(`/menu/${props.menu.menuId}/edit`, formData, props.refresh) 82 } 83 78 84 }} 79 85 > -
frontend/src/Components/Forms/AddTripForm.js
r07f4e8b r0f5aa27 272 272 273 273 for (let i = 0; i < Object.values(routesForm).length; i++) { 274 console.log(findDependantRoutes(wayPointNames, routesForm, i))275 274 setDependencies(prevState => [...prevState, findDependantRoutes(wayPointNames, routesForm, i)]) 276 275 } 277 console.log('VO STATEOOOO')278 console.log(dependencies)279 276 routesSetFormData(routesForm) 280 277 setRoutes(routesVar)
Note:
See TracChangeset
for help on using the changeset viewer.