mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
fix: bulk actions — add tariff info to user list, fix tariff column display
- Update UserListItem type to include tariff_id, tariff_name, traffic_used_gb, traffic_limit_gb, device_limit, days_remaining from the backend (now returned in user list API) - Fix tariff column: was showing subscription_status, now shows actual tariff_name from the API response
This commit is contained in:
@@ -49,6 +49,12 @@ export interface UserListItem {
|
|||||||
subscription_status: string | null;
|
subscription_status: string | null;
|
||||||
subscription_is_trial: boolean;
|
subscription_is_trial: boolean;
|
||||||
subscription_end_date: string | null;
|
subscription_end_date: string | null;
|
||||||
|
tariff_id: number | null;
|
||||||
|
tariff_name: string | null;
|
||||||
|
traffic_used_gb: number;
|
||||||
|
traffic_limit_gb: number;
|
||||||
|
device_limit: number;
|
||||||
|
days_remaining: number;
|
||||||
promo_group_id: number | null;
|
promo_group_id: number | null;
|
||||||
promo_group_name: string | null;
|
promo_group_name: string | null;
|
||||||
total_spent_kopeks: number;
|
total_spent_kopeks: number;
|
||||||
|
|||||||
@@ -1245,22 +1245,15 @@ export default function AdminBulkActions() {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'tariff',
|
id: 'tariff',
|
||||||
accessorFn: (row) => row.promo_group_name,
|
accessorFn: (row) => row.tariff_name,
|
||||||
header: t('admin.bulkActions.columns.tariff'),
|
header: t('admin.bulkActions.columns.tariff'),
|
||||||
size: 120,
|
size: 120,
|
||||||
cell: ({ row }) => {
|
cell: ({ row }) => {
|
||||||
// UserListItem doesn't have tariff_name directly; we'll show subscription info
|
|
||||||
const user = row.original;
|
const user = row.original;
|
||||||
if (!user.has_subscription) {
|
if (!user.tariff_name) {
|
||||||
return <span className="text-xs text-dark-500">-</span>;
|
return <span className="text-xs text-dark-500">—</span>;
|
||||||
}
|
}
|
||||||
return (
|
return <span className="text-xs text-dark-200">{user.tariff_name}</span>;
|
||||||
<span className="text-xs text-dark-300">
|
|
||||||
{user.subscription_status === 'trial'
|
|
||||||
? t('admin.bulkActions.statuses.trial')
|
|
||||||
: user.subscription_status || '-'}
|
|
||||||
</span>
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user