File tree Expand file tree Collapse file tree 2 files changed +10
-13
lines changed
src/apps/wallet-admin/src
lib/components/payment-edit Expand file tree Collapse file tree 2 files changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ const ListView: FC<ListViewProps> = (props: ListViewProps) => {
217217 if ( updateObj . paymentStatus !== undefined ) {
218218 if ( updateObj . paymentStatus === 'Owed' ) {
219219 paymentStatus = 'OWED'
220- } else if ( updateObj . paymentStatus === 'On Hold' ) {
220+ } else if ( updateObj . paymentStatus === 'On Hold (Admin) ' ) {
221221 paymentStatus = 'ON_HOLD_ADMIN'
222222 } else if ( updateObj . paymentStatus === 'Cancel' ) {
223223 paymentStatus = 'CANCELLED'
@@ -267,24 +267,14 @@ const ListView: FC<ListViewProps> = (props: ListViewProps) => {
267267 } , [ fetchWinnings ] )
268268
269269 const onPaymentEditCallback = useCallback ( ( payment : Winning ) => {
270- let status = payment . status
271- if ( status === 'On Hold (Admin)' ) {
272- status = 'On Hold'
273- } else if ( [ 'On Hold (Member)' , 'On Hold (Tax Form)' , 'On Hold (Payment Provider)' ] . indexOf ( status ) !== - 1 ) {
274- status = 'Owed'
275- }
276-
277270 setConfirmFlow ( {
278271 action : 'Save' ,
279272 callback : async ( ) => {
280273 updatePayment ( payment . id )
281274 } ,
282275 content : (
283276 < PaymentEditForm
284- payment = { {
285- ...payment ,
286- status,
287- } }
277+ payment = { payment }
288278 canSave = { setIsConfirmFormValid }
289279 onValueUpdated = { handleValueUpdated }
290280 />
Original file line number Diff line number Diff line change @@ -179,9 +179,16 @@ const PaymentEdit: React.FC<PaymentEditFormProps> = (props: PaymentEditFormProps
179179
180180 const options = useCallback ( ( ) => {
181181 if ( props . payment . status . toUpperCase ( ) !== 'PAID' ) {
182+ const isMemberHold = [
183+ 'On Hold (Member)' ,
184+ 'On Hold (Tax Form)' ,
185+ 'On Hold (Payment Provider)' ,
186+ ] . includes ( props . payment . status )
187+
182188 return [
189+ ...( isMemberHold ? [ { label : props . payment . status , value : props . payment . status } ] : [ ] ) ,
183190 { label : 'Owed' , value : 'Owed' } ,
184- { label : 'On Hold' , value : 'On Hold' } ,
191+ { label : 'On Hold (Admin) ' , value : 'On Hold (Admin) ' } ,
185192 { label : 'Cancel' , value : 'Cancel' } ,
186193 ]
187194 }
You can’t perform that action at this time.
0 commit comments