правка бага отображения посуды и категорий для редактирования коктейлей
This commit is contained in:
@@ -11,7 +11,6 @@ import {requests} from "../../../requests";
|
|||||||
import {useAlert} from "../../../hooks/useAlert";
|
import {useAlert} from "../../../hooks/useAlert";
|
||||||
import Stack from "@mui/material/Stack";
|
import Stack from "@mui/material/Stack";
|
||||||
import Button from "@mui/material/Button";
|
import Button from "@mui/material/Button";
|
||||||
import CheckMarks from "../../../components/cocktails/CheckMarks";
|
|
||||||
import {EditCocktailReceipt} from "../../../components/cocktails/EditCocktailReceipt";
|
import {EditCocktailReceipt} from "../../../components/cocktails/EditCocktailReceipt";
|
||||||
import {SelectEdit} from "../../../components/cocktails/SelectEdit";
|
import {SelectEdit} from "../../../components/cocktails/SelectEdit";
|
||||||
import {getComparator} from "../../../components/core/getComparator";
|
import {getComparator} from "../../../components/core/getComparator";
|
||||||
@@ -97,11 +96,19 @@ export function EditCocktailPage() {
|
|||||||
.catch(() => createError("Ошибка получения данных"))
|
.catch(() => createError("Ошибка получения данных"))
|
||||||
|
|
||||||
api().get(requests.bar.category)
|
api().get(requests.bar.category)
|
||||||
.then((r) => setCategory(r.data.sort(getComparator())))
|
.then((r) => {
|
||||||
|
setCategory(r.data.sort(getComparator())
|
||||||
|
.map((item, i) => {
|
||||||
|
return {id: i, name: item}
|
||||||
|
}))
|
||||||
|
})
|
||||||
.catch(() => createError("Ошибка получения категорий"))
|
.catch(() => createError("Ошибка получения категорий"))
|
||||||
|
|
||||||
api().get(requests.bar.glass)
|
api().get(requests.bar.glass)
|
||||||
.then((r) => setGlass(r.data.sort(getComparator())))
|
.then((r) => setGlass(r.data.sort(getComparator())
|
||||||
|
.map((item, i) => {
|
||||||
|
return {id: i, name: item}
|
||||||
|
})))
|
||||||
.catch(() => createError("Ошибка получения посуды"))
|
.catch(() => createError("Ошибка получения посуды"))
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
}, []);
|
}, []);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import MenuItem from "@mui/material/MenuItem";
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
export function SelectEdit({label, value, array, handler, attributeName, width, margin}) {
|
export function SelectEdit({label, value, array, handler, attributeName, width, margin}) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FormControl sx={{width: width, m: margin}}>
|
<FormControl sx={{width: width, m: margin}}>
|
||||||
<InputLabel>{label}</InputLabel>
|
<InputLabel>{label}</InputLabel>
|
||||||
|
|||||||
Reference in New Issue
Block a user