File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -27,14 +27,15 @@ import { zodResolver } from "@hookform/resolvers/zod"
2727import { useState } from "react"
2828import { useForm } from "react-hook-form"
2929import { useTranslation } from "react-i18next"
30+ import { asOptionalField } from "@/lib/utils"
3031import { toast } from "sonner"
3132import { z } from "zod"
3233
3334const profileFormSchema = z . object ( {
3435 original_password : z . string ( ) . min ( 5 ) . max ( 72 ) ,
3536 new_password : z . string ( ) . min ( 8 ) . max ( 72 ) ,
3637 new_username : z . string ( ) . min ( 1 ) . max ( 32 ) ,
37- reject_password : z . boolean ( ) ,
38+ reject_password : asOptionalField ( z . boolean ( ) ) ,
3839} )
3940
4041export const ProfileCard = ( { className } : { className : string } ) => {
Original file line number Diff line number Diff line change @@ -506,7 +506,7 @@ export interface ModelProfileForm {
506506 new_password : string ;
507507 new_username : string ;
508508 original_password : string ;
509- reject_password : boolean ;
509+ reject_password ? : boolean ;
510510}
511511
512512export interface ModelRule {
You can’t perform that action at this time.
0 commit comments