court value update

PHOTO EMBED

Mon Dec 18 2023 07:06:44 GMT+0000 (Coordinated Universal Time)

Saved by @chiragwebelight #reactj

 const handleOnInputChange = (reason?: string, id?: string | null) => {
    if (!id) {
      setPreviewUrl(null);
      setValue("type", 2);
      reset({ type: 2 });
      if (feeType === FeeType.sameFees) {
        const editCourtValueReset: FormProps = {
          ...getAllValues,
          name: "",
          gameId: "",
          courtId: "",
          midNight: "",
          morning: "",
          evening: "",
          night: "",
          image: "",
        };
        // setValue("midNight", "");
        // setValue("morning", "");
        // setValue("evening", "");
        // setValue("night", "");
        // setValue("courtId", "");

        reset(editCourtValueReset);
      } else {
        setValue("type", 2);
        const dayWiseValues = {
          ...getAllValues,
          name: "",
          // gameId: "",
          // courtId: "",
          midNight: "",
          morning: "",
          evening: "",
          night: "",
          image: "",
          // fees: DAYWISE_FEE,
          type: 2,
        };
        setFeeType(2);
        setDayWiseFeesData(DAYWISE_FEE);
        reset(dayWiseValues);
      }
    }
  };
content_copyCOPY