File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
apps/cyberstorm-remix/app/settings/teams/team/tabs/Profile
packages/thunderstore-api/src/schemas Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,9 @@ function ProfileForm(props: { team: TeamDetails }) {
9090 InputErrors
9191 > ( {
9292 inputs : formInputs ,
93+ refiner : async ( inputs : typeof formInputs ) => ( {
94+ donation_link : nullForEmptyString ( inputs . donation_link ) ,
95+ } ) ,
9396 submitor,
9497 onSubmitSuccess : ( ) => {
9598 toast . addToast ( {
@@ -120,7 +123,7 @@ function ProfileForm(props: { team: TeamDetails }) {
120123 < NewTextInput
121124 name = { "donation_link" }
122125 placeholder = { "https://" }
123- value = { formInputs . donation_link }
126+ value = { formInputs . donation_link ?? "" }
124127 onChange = { ( e ) =>
125128 updateFormFieldState ( {
126129 field : "donation_link" ,
@@ -140,3 +143,6 @@ function ProfileForm(props: { team: TeamDetails }) {
140143}
141144
142145ProfileForm . displayName = "ProfileForm" ;
146+
147+ const nullForEmptyString = ( value : string | null ) : string | null =>
148+ value ?. trim ( ) === "" ? null : value ;
Original file line number Diff line number Diff line change @@ -622,7 +622,7 @@ export type TeamDetailsEditRequestParams = z.infer<
622622> ;
623623
624624export const teamDetailsEditRequestDataSchema = z . object ( {
625- donation_link : z . string ( ) . min ( 1 ) . max ( 1024 ) ,
625+ donation_link : z . string ( ) . min ( 1 ) . max ( 1024 ) . nullable ( ) ,
626626} ) ;
627627
628628export type TeamDetailsEditRequestData = z . infer <
Original file line number Diff line number Diff line change @@ -353,7 +353,7 @@ export type MarkdownRenderResponseData = z.infer<
353353
354354// TeamDetailsEditResponse
355355export const teamDetailsEditResponseSchema = z . object ( {
356- donation_link : z . string ( ) . min ( 1 ) . max ( 1024 ) ,
356+ donation_link : z . string ( ) . min ( 1 ) . max ( 1024 ) . nullable ( ) ,
357357} ) ;
358358
359359export type TeamDetailsEditResponseData = z . infer <
You can’t perform that action at this time.
0 commit comments