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