fix PutPrivilegies
This commit is contained in:
parent
7ef0ac60a8
commit
7ee5df05f2
@ -6,7 +6,7 @@ import ModeEditOutlineOutlinedIcon from "@mui/icons-material/ModeEditOutlineOutl
|
|||||||
|
|
||||||
interface CardPrivilegie {
|
interface CardPrivilegie {
|
||||||
name: string;
|
name: string;
|
||||||
type: string;
|
type: "count" | "day" | "mb";
|
||||||
price: string;
|
price: string;
|
||||||
description: string;
|
description: string;
|
||||||
value: string;
|
value: string;
|
||||||
@ -19,6 +19,12 @@ export const СardPrivilegie = ({ name, type, price, description, value, privile
|
|||||||
const [inputValue, setInputValue] = useState<string>("");
|
const [inputValue, setInputValue] = useState<string>("");
|
||||||
const priceRef = useRef<any>(null);
|
const priceRef = useRef<any>(null);
|
||||||
|
|
||||||
|
const translationType = {
|
||||||
|
count: "за единицу",
|
||||||
|
day: "за день",
|
||||||
|
mb: "за МБ",
|
||||||
|
};
|
||||||
|
|
||||||
const PutPrivilegies = () => {
|
const PutPrivilegies = () => {
|
||||||
axios({
|
axios({
|
||||||
method: "put",
|
method: "put",
|
||||||
@ -132,7 +138,7 @@ export const СardPrivilegie = ({ name, type, price, description, value, privile
|
|||||||
price: {price}
|
price: {price}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<Typography sx={{ color: "white" }}>{type}</Typography>
|
<Typography sx={{ color: "white" }}>{translationType[type]}</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
@ -5,12 +5,6 @@ import { usePrivilegies } from "@root/hooks/privilege.hook";
|
|||||||
export default function ListPrivilegie() {
|
export default function ListPrivilegie() {
|
||||||
const { privilegies, isError, isLoading, errorMessage } = usePrivilegies();
|
const { privilegies, isError, isLoading, errorMessage } = usePrivilegies();
|
||||||
|
|
||||||
const translationType = {
|
|
||||||
count: "за единицу",
|
|
||||||
day: "за день",
|
|
||||||
mb: "за МБ",
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{isError ? (
|
{isError ? (
|
||||||
@ -20,7 +14,7 @@ export default function ListPrivilegie() {
|
|||||||
<СardPrivilegie
|
<СardPrivilegie
|
||||||
key={_id}
|
key={_id}
|
||||||
name={name}
|
name={name}
|
||||||
type={translationType[type]}
|
type={type}
|
||||||
price={price}
|
price={price}
|
||||||
value={value}
|
value={value}
|
||||||
privilegeId={privilegeId}
|
privilegeId={privilegeId}
|
||||||
|
Loading…
Reference in New Issue
Block a user