web client v0.7 (edit dish / visibility / delete/ routes)
This commit is contained in:
@@ -54,8 +54,8 @@ export default function Checkboxes(props) {
|
||||
<Checkbox
|
||||
checked={state.gluten}
|
||||
onChange={() => {
|
||||
props.onUpdate({ ...state, gluten: !state.gluten });
|
||||
setState({ ...state, gluten: !state.gluten });
|
||||
props.onUpdate(state);
|
||||
}}
|
||||
name="gluten"
|
||||
/>
|
||||
@@ -67,8 +67,8 @@ export default function Checkboxes(props) {
|
||||
<Checkbox
|
||||
checked={state.lactose}
|
||||
onChange={() => {
|
||||
props.onUpdate({ ...state, lactose: !state.lactose });
|
||||
setState({ ...state, lactose: !state.lactose });
|
||||
props.onUpdate(state);
|
||||
}}
|
||||
name="lactose"
|
||||
/>
|
||||
@@ -80,8 +80,8 @@ export default function Checkboxes(props) {
|
||||
<Checkbox
|
||||
checked={state.soy}
|
||||
onChange={() => {
|
||||
props.onUpdate({ ...state, soy: !state.soy });
|
||||
setState({ ...state, soy: !state.soy });
|
||||
props.onUpdate(state);
|
||||
}}
|
||||
name="soy"
|
||||
/>
|
||||
@@ -93,8 +93,8 @@ export default function Checkboxes(props) {
|
||||
<Checkbox
|
||||
checked={state.eggs}
|
||||
onChange={() => {
|
||||
props.onUpdate({ ...state, eggs: !state.eggs });
|
||||
setState({ ...state, eggs: !state.eggs });
|
||||
props.onUpdate(state);
|
||||
}}
|
||||
name="eggs"
|
||||
/>
|
||||
@@ -106,8 +106,8 @@ export default function Checkboxes(props) {
|
||||
<Checkbox
|
||||
checked={state.seaFood}
|
||||
onChange={() => {
|
||||
props.onUpdate({ ...state, seaFood: !state.seaFood });
|
||||
setState({ ...state, seaFood: !state.seaFood });
|
||||
props.onUpdate(state);
|
||||
}}
|
||||
name="seaFood"
|
||||
/>
|
||||
@@ -119,8 +119,8 @@ export default function Checkboxes(props) {
|
||||
<Checkbox
|
||||
checked={state.peanuts}
|
||||
onChange={() => {
|
||||
props.onUpdate({ ...state, peanuts: !state.peanuts });
|
||||
setState({ ...state, peanuts: !state.peanuts });
|
||||
props.onUpdate(state);
|
||||
}}
|
||||
name="peanuts"
|
||||
/>
|
||||
@@ -132,8 +132,8 @@ export default function Checkboxes(props) {
|
||||
<Checkbox
|
||||
checked={state.sesame}
|
||||
onChange={() => {
|
||||
props.onUpdate({ ...state, sesame: !state.sesame });
|
||||
setState({ ...state, sesame: !state.sesame });
|
||||
props.onUpdate(state);
|
||||
}}
|
||||
name="sesame"
|
||||
/>
|
||||
|
||||
@@ -2,6 +2,7 @@ import React, { useState } from "react";
|
||||
import CircularProgress from "@material-ui/core/CircularProgress";
|
||||
import { useSelector } from "react-redux";
|
||||
import axios from "axios";
|
||||
import { backend } from "../../config";
|
||||
|
||||
export default function ImageUpload(props) {
|
||||
const { img } = props;
|
||||
@@ -13,7 +14,7 @@ export default function ImageUpload(props) {
|
||||
data.append("menuiImage", event.target.files[0]);
|
||||
setLoading(true);
|
||||
axios({
|
||||
url: "http://localhost:4000/img",
|
||||
url: backend + "/img",
|
||||
method: "POST",
|
||||
data: data,
|
||||
headers: {
|
||||
|
||||
@@ -2,6 +2,7 @@ import React, { useState } from "react";
|
||||
import CircularProgress from "@material-ui/core/CircularProgress";
|
||||
import { useSelector } from "react-redux";
|
||||
import axios from "axios";
|
||||
import { backend } from "../../config";
|
||||
|
||||
export default function ImageUpload(props) {
|
||||
const { img } = props;
|
||||
@@ -13,7 +14,7 @@ export default function ImageUpload(props) {
|
||||
data.append("menuiImage", event.target.files[0]);
|
||||
setLoading(true);
|
||||
axios({
|
||||
url: "http://localhost:4000/img",
|
||||
url: backend + "/img",
|
||||
method: "POST",
|
||||
data: data,
|
||||
headers: {
|
||||
|
||||
Reference in New Issue
Block a user