@@ -65,6 +65,7 @@ export const OptionalLoveUserForm = (props: {
6565 const handleSubmit = async ( ) => {
6666 setIsSubmitting ( true )
6767 const { bio : _ , ...otherProfileProps } = profile
68+ console . log ( 'otherProfileProps' , removeNullOrUndefinedProps ( otherProfileProps ) )
6869 const { error} = await tryCatch (
6970 updateProfile ( removeNullOrUndefinedProps ( otherProfileProps ) as any )
7071 )
@@ -198,7 +199,7 @@ export const OptionalLoveUserForm = (props: {
198199 value = { profile [ 'age' ] ?? undefined }
199200 min = { 18 }
200201 max = { 100 }
201- onChange = { ( e ) => setProfile ( 'age' , Number ( e . target . value ) ) }
202+ onChange = { ( e ) => setProfile ( 'age' , e . target . value ? Number ( e . target . value ) : null ) }
202203 />
203204 </ Col >
204205
@@ -238,7 +239,7 @@ export const OptionalLoveUserForm = (props: {
238239 < Select
239240 value = { profile [ 'pref_age_min' ] ?? '' }
240241 onChange = { ( e ) =>
241- setProfile ( 'pref_age_min' , Number ( e . target . value ) )
242+ setProfile ( 'pref_age_min' , e . target . value ? Number ( e . target . value ) : 18 )
242243 }
243244 className = { 'w-18 border-ink-300 rounded-md' }
244245 >
@@ -255,7 +256,7 @@ export const OptionalLoveUserForm = (props: {
255256 < Select
256257 value = { profile [ 'pref_age_max' ] ?? '' }
257258 onChange = { ( e ) =>
258- setProfile ( 'pref_age_max' , Number ( e . target . value ) )
259+ setProfile ( 'pref_age_max' , e . target . value ? Number ( e . target . value ) : 100 )
259260 }
260261 className = { 'w-18 border-ink-300 rounded-md' }
261262 >
0 commit comments