From bd3feeb78f5c724a5b22eb7e8e65c7f4827a8096 Mon Sep 17 00:00:00 2001 From: "sosuke.iwabuchi" Date: Wed, 3 Apr 2024 10:53:36 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=81=E3=83=A3=E3=83=BC=E3=82=B8=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../詳細/デポジットチャージ.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/pages/dashboard/shop/店舗詳細/詳細/デポジットチャージ.tsx b/src/pages/dashboard/shop/店舗詳細/詳細/デポジットチャージ.tsx index 3d5b2ca..177c6c2 100644 --- a/src/pages/dashboard/shop/店舗詳細/詳細/デポジットチャージ.tsx +++ b/src/pages/dashboard/shop/店舗詳細/詳細/デポジットチャージ.tsx @@ -3,12 +3,12 @@ import { Box, Button, Card, Grid, Stack, Typography } from "@mui/material"; import { デポジットチャージ } from "api/shop"; import { FormProvider, RHFTextField } from "components/hook-form"; import StackRow from "components/stack/StackRow"; +import { 店舗詳細Context } from "contexts/page/dashboard/shop/店舗詳細Context"; import useAPICall from "hooks/useAPICall"; import useSnackbarCustom from "hooks/useSnackbarCustom"; import { useContext } from "react"; import { useForm } from "react-hook-form"; import { number, object } from "yup"; -import { 店舗詳細Context } from "contexts/page/dashboard/shop/店舗詳細Context"; type FormProps = { amount: string; @@ -26,8 +26,12 @@ export default function デポジットチャージ_() { object().shape({ amount: number() .typeError("数値を入力してください") - .min(1, "1円-10万円まで入力できます") - .max(100000, "1円-10万円まで入力できます"), + .integer("整数で入力してください") + .min(-100000, "-10万円から10万円まで入力できます") + .max(100000, "-10万円から10万円まで入力できます") + .test("0除外", "0は入力できません", function (value) { + return value !== 0; + }), }) ), });