| @@ -3,12 +3,12 @@ import { Box, Button, Card, Grid, Stack, Typography } from "@mui/material"; | |||||
| import { デポジットチャージ } from "api/shop"; | import { デポジットチャージ } from "api/shop"; | ||||
| import { FormProvider, RHFTextField } from "components/hook-form"; | import { FormProvider, RHFTextField } from "components/hook-form"; | ||||
| import StackRow from "components/stack/StackRow"; | import StackRow from "components/stack/StackRow"; | ||||
| import { 店舗詳細Context } from "contexts/page/dashboard/shop/店舗詳細Context"; | |||||
| import useAPICall from "hooks/useAPICall"; | import useAPICall from "hooks/useAPICall"; | ||||
| import useSnackbarCustom from "hooks/useSnackbarCustom"; | import useSnackbarCustom from "hooks/useSnackbarCustom"; | ||||
| import { useContext } from "react"; | import { useContext } from "react"; | ||||
| import { useForm } from "react-hook-form"; | import { useForm } from "react-hook-form"; | ||||
| import { number, object } from "yup"; | import { number, object } from "yup"; | ||||
| import { 店舗詳細Context } from "contexts/page/dashboard/shop/店舗詳細Context"; | |||||
| type FormProps = { | type FormProps = { | ||||
| amount: string; | amount: string; | ||||
| @@ -26,8 +26,12 @@ export default function デポジットチャージ_() { | |||||
| object().shape({ | object().shape({ | ||||
| amount: number() | amount: number() | ||||
| .typeError("数値を入力してください") | .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; | |||||
| }), | |||||
| }) | }) | ||||
| ), | ), | ||||
| }); | }); | ||||