| @@ -47,8 +47,10 @@ | ||
| 47 | 47 | trip_title: string; |
| 48 | 48 | amount: number; |
| 49 | 49 | currency?: string; |
| 50 | 50 | payment_method: string; |
| 51 | + /** Resolved display label; falls back to payment_method when absent */ | |
| 52 | + payment_method_label?: string; | |
| 51 | 53 | payment_status: |
| 52 | 54 | | "pending" |
| 53 | 55 | | "completed" |
| 54 | 56 | | "failed" |
| @@ -155,8 +157,17 @@ | ||
| 155 | 157 | } |
| 156 | 158 | if (queryParams.payment_method) { |
| 157 | 159 | paramsObj.gateway = queryParams.payment_method; |
| 158 | 160 | } |
| 161 | + // Forward the sort params — they were in queryParams (so the query | |
| 162 | + // refetched on a header click) but never reached the request, so the | |
| 163 | + // backend always returned the default order. | |
| 164 | + if (queryParams.orderby) { | |
| 165 | + paramsObj.orderby = queryParams.orderby; | |
| 166 | + } | |
| 167 | + if (queryParams.order) { | |
| 168 | + paramsObj.order = queryParams.order; | |
| 169 | + } | |
| 159 | 170 | |
| 160 | 171 | return await apiService.getPayments(paramsObj); |
| 161 | 172 | }, |
| 162 | 173 | enabled: can("yatra_view_bookings"), |
| @@ -569,9 +580,9 @@ | ||
| 569 | 580 | sortable: true, |
| 570 | 581 | visible: visibleColumns.method, |
| 571 | 582 | render: (payment: Payment) => ( |
| 572 | 583 | <span className="text-gray-600 dark:text-gray-400"> |
| 573 | - {payment.payment_method} | |
| 584 | + {payment.payment_method_label || payment.payment_method} | |
| 574 | 585 | </span> |
| 575 | 586 | ), |
| 576 | 587 | }, |
| 577 | 588 | { |