LFFE-19 set maximum limit for max number
This commit is contained in:
@@ -206,7 +206,7 @@
|
||||
"upload_file_required": "وارد کردن صورت جلسه کارگروه استانی الزامیست",
|
||||
"upload_file_unit": "فایل بارگذاری شده باید حداکثر 2Mb باشد",
|
||||
"upload_file_format": "فرمت قابل قبول : png,jpg,pdf",
|
||||
"max_amount": "حداکثر مبلغ پیشنهادی {value} هزار تومان می باشد"
|
||||
"max_amount": "حداکثر مبلغ پیشنهادی {value} تومان می باشد"
|
||||
},
|
||||
"RefahiProvinceManager": {
|
||||
"name": "نام",
|
||||
|
||||
@@ -10,6 +10,7 @@ import PriceField from "@/core/components/PriceField";
|
||||
import * as Yup from "yup";
|
||||
|
||||
const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog}) => {
|
||||
const max_amount_number = 70000000000
|
||||
const t = useTranslations();
|
||||
const [selectedImage, setSelectedImage] = useState("");
|
||||
const [fileType, setfileType] = useState(null);
|
||||
@@ -23,7 +24,7 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog}) => {
|
||||
"is-number",
|
||||
`${t("ConfirmDialog.proposed_amount_number")}`,
|
||||
(value) => !isNaN(value)
|
||||
).test("max-amount", `${t("MachinaryOffice.max_amount", {value: 7000})}`, (value) => value <= 7000)
|
||||
).test("max-amount", `${t("MachinaryOffice.max_amount", {value: parseInt(max_amount_number).toLocaleString('en')})}`, (value) => value <= max_amount_number)
|
||||
.test("positive", `${t("ConfirmDialog.proposed_amount_positive")}`, (value) => value >= 0)
|
||||
.required(t("ConfirmDialog.proposed_amount_error")),
|
||||
confirm_img: Yup.mixed()
|
||||
|
||||
@@ -10,6 +10,7 @@ import PriceField from "@/core/components/PriceField";
|
||||
import * as Yup from "yup";
|
||||
|
||||
const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog}) => {
|
||||
const max_amount_number = 70000000000
|
||||
const t = useTranslations();
|
||||
const [selectedImage, setSelectedImage] = useState("");
|
||||
const [fileType, setfileType] = useState(null);
|
||||
@@ -18,12 +19,13 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog}) => {
|
||||
const requestServer = useRequest({auth: true})
|
||||
const {update_notification} = useNotification()
|
||||
|
||||
|
||||
const validationSchema = Yup.object().shape({
|
||||
approved_amount: Yup.mixed().test(
|
||||
"is-number",
|
||||
`${t("ConfirmDialog.approved_amount_number")}`,
|
||||
(value) => !isNaN(value)
|
||||
).test("max-amount", `${t("PassengerBoss.max_amount", {value: 7000})}`, (value) => value <= 7000)
|
||||
).test("max-amount", `${t("PassengerBoss.max_amount", {value: parseInt(max_amount_number).toLocaleString('en')})}`, (value) => value <= max_amount_number)
|
||||
.test("positive", `${t("ConfirmDialog.approved_amount_positive")}`, (value) => value >= 0)
|
||||
.required(t("ConfirmDialog.approved_amount_error")),
|
||||
confirm_img: Yup.mixed()
|
||||
|
||||
Reference in New Issue
Block a user