@@ -37,6 +37,8 @@ function formatStatus(status: string): string {
3737 return 'Paid'
3838 case 'CANCELLED' :
3939 return 'Cancel'
40+ case 'PROCESSING' :
41+ return 'Processing'
4042 default :
4143 return status . replaceAll ( '_' , ' ' )
4244 }
@@ -217,6 +219,7 @@ const ListView: FC<ListViewProps> = (props: ListViewProps) => {
217219 return confirmFlow ?. content
218220 } , [ confirmFlow ] )
219221
222+ // eslint-disable-next-line complexity
220223 const updatePayment = async ( paymentId : string ) : Promise < void > => {
221224 const currentEditState = editStateRef . current
222225 // Send to server only the fields that have changed
@@ -257,10 +260,15 @@ const ListView: FC<ListViewProps> = (props: ListViewProps) => {
257260
258261 toast . success ( 'Updating payment' , { position : toast . POSITION . BOTTOM_RIGHT } )
259262 try {
260- const udpateMessage = await editPayment ( updates )
261- toast . success ( udpateMessage , { position : toast . POSITION . BOTTOM_RIGHT } )
262- } catch ( err ) {
263- toast . error ( 'Failed to update payment' , { position : toast . POSITION . BOTTOM_RIGHT } )
263+ const updateMessage = await editPayment ( updates )
264+ toast . success ( updateMessage , { position : toast . POSITION . BOTTOM_RIGHT } )
265+ } catch ( err :any ) {
266+ if ( err ?. message ) {
267+ toast . error ( err ?. message , { position : toast . POSITION . BOTTOM_RIGHT } )
268+ } else {
269+ toast . error ( 'Failed to update payment' , { position : toast . POSITION . BOTTOM_RIGHT } )
270+ }
271+
264272 return
265273 }
266274
@@ -352,6 +360,10 @@ const ListView: FC<ListViewProps> = (props: ListViewProps) => {
352360 label : 'Cancelled' ,
353361 value : 'CANCELLED' ,
354362 } ,
363+ {
364+ label : 'Processing' ,
365+ value : 'PROCESSING' ,
366+ } ,
355367 ] ,
356368 type : 'dropdown' ,
357369 } ,
0 commit comments