refactor: transform payload status to number in subscribe plan requests and update type definitions

This commit is contained in:
Ardeman
2025-03-13 07:01:53 +08:00
parent f40f2dadde
commit 6878da0db2
10 changed files with 142 additions and 28 deletions
+5 -3
View File
@@ -2,7 +2,7 @@ import DT from 'datatables.net-dt'
import DataTable from 'datatables.net-react'
import { Link, useRouteLoaderData } from 'react-router'
import type { TSubscribePlanSchema } from '~/apis/common/get-subscribe-plan'
import type { TSubscribePlanResponse } from '~/apis/common/get-subscribe-plan'
import { Button } from '~/components/ui/button'
import { getStatusBadge, type TColorBadge } from '~/components/ui/color-badge'
import { UiTable } from '~/components/ui/table'
@@ -66,8 +66,10 @@ export const SubscribePlanPage = () => {
{value === 1 ? 'Active' : 'Inactive'}
</span>
),
6: (value: string, _type: unknown, data: TSubscribePlanSchema) =>
data.code !== 'basic' && (
6: (value: string, _type: unknown, data: TSubscribePlanResponse) =>
data.code === 'basic' ? (
''
) : (
<Button
as="a"
href={`/lg-admin/subscribe-plan/update/${value}`}