feat: add description to tariff

This commit is contained in:
skeris 2023-12-15 19:24:47 +03:00
parent c7d1c90ab8
commit 05e7d399f3
2 changed files with 27 additions and 0 deletions

@ -8,6 +8,7 @@ import type { EditTariffRequestBody } from "@root/model/tariff";
type CreateTariffBackendRequest = {
name: string;
description: string;
price: number;
isCustom: boolean;
privileges: Omit<PrivilegeWithAmount, "_id" | "updatedAt">[];

@ -23,6 +23,7 @@ import { Formik, Field, Form, FormikHelpers } from "formik";
interface Values {
nameField: string,
descriptionField: string,
amountField: string,
customPriceField: string,
privilegeIdField: string,
@ -53,6 +54,7 @@ export default function CreateTariff() {
const initialValues: Values = {
nameField: "",
descriptionField: "",
amountField: "",
customPriceField: "",
privilegeIdField: "",
@ -68,6 +70,7 @@ export default function CreateTariff() {
name: values.nameField,
price: Number(values.customPriceField) * 100,
isCustom: false,
description: values.descriptionField,
privileges: [
{
name: values.privilege.name,
@ -283,6 +286,29 @@ export default function CreateTariff() {
}
}}
/>
<TextField
id="tariff-dezcription"
name="descriptionField"
variant="filled"
onChange={(e) => {
props.setFieldValue("descriptionField", e.target.value)
}}
value={props.values.descriptionField}
onBlur={props.handleBlur}
label="Описание"
multiline={true}
InputProps={{
style: {
backgroundColor: theme.palette.content.main,
color: theme.palette.secondary.main,
}
}}
InputLabelProps={{
style: {
color: theme.palette.secondary.main
}
}}
/>
<Button
className="btn_createTariffBackend"
type="submit"