File tree Expand file tree Collapse file tree
app/dashboard/cash-flow/envelopes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -114,6 +114,7 @@ export const envelopeColumns = [
114114 </ div >
115115
116116 < Progress
117+ key = { progressValue . toNumber ( ) }
117118 value = { progressValue . toNumber ( ) }
118119 className = { cn (
119120 "max-w-[300px]" ,
Original file line number Diff line number Diff line change @@ -70,11 +70,7 @@ export const envelopeRouter = createTRPCRouter({
7070 . mutation ( async ( { input, ctx } ) => {
7171 const updated = await ctx . db . envelope . update ( {
7272 where : { id : input . id , createdById : ctx . session . user . id } ,
73- data : {
74- ...( input . target ? { target : input . target } : { } ) ,
75- name : input . name ,
76- amount : input . amount ,
77- } ,
73+ data : input ,
7874 } ) ;
7975
8076 return updated ;
Original file line number Diff line number Diff line change @@ -2,7 +2,12 @@ import * as yup from "yup";
22
33export const createEnvelopeSchema = yup . object ( {
44 name : yup . string ( ) . label ( "Name" ) . required ( ) ,
5- target : yup . number ( ) . label ( "Target" ) . optional ( ) ,
5+ target : yup
6+ . number ( )
7+ . label ( "Target" )
8+ . optional ( )
9+ . nullable ( )
10+ . transform ( ( value ) => ( isNaN ( value ) ? null : value ) ) ,
611 amount : yup . number ( ) . label ( "Amount" ) . required ( ) ,
712 priority : yup . number ( ) . label ( "Priority" ) . required ( ) ,
813} ) ;
You can’t perform that action at this time.
0 commit comments