✨ feat(subscribe): Update SubscribeTable component to use API.SubscribeItem type and ensure proper type casting
This commit is contained in:
parent
c59742a4f3
commit
f26f1c24ae
@ -36,7 +36,7 @@ export default function SubscribeTable() {
|
|||||||
});
|
});
|
||||||
const ref = useRef<ProTableActions>(null);
|
const ref = useRef<ProTableActions>(null);
|
||||||
return (
|
return (
|
||||||
<ProTable<API.Subscribe, { group_id: number; query: string }>
|
<ProTable<API.SubscribeItem, { group_id: number; query: string }>
|
||||||
action={ref}
|
action={ref}
|
||||||
header={{
|
header={{
|
||||||
toolbar: (
|
toolbar: (
|
||||||
@ -186,7 +186,7 @@ export default function SubscribeTable() {
|
|||||||
]}
|
]}
|
||||||
actions={{
|
actions={{
|
||||||
render: (row) => [
|
render: (row) => [
|
||||||
<SubscribeForm<API.Subscribe>
|
<SubscribeForm<API.SubscribeItem>
|
||||||
key='edit'
|
key='edit'
|
||||||
trigger={t('edit')}
|
trigger={t('edit')}
|
||||||
title={t('editSubscribe')}
|
title={t('editSubscribe')}
|
||||||
@ -221,7 +221,7 @@ export default function SubscribeTable() {
|
|||||||
...params,
|
...params,
|
||||||
show: false,
|
show: false,
|
||||||
sell: false,
|
sell: false,
|
||||||
});
|
} as API.CreateSubscribeRequest);
|
||||||
toast.success(t('copySuccess'));
|
toast.success(t('copySuccess'));
|
||||||
ref.current?.refresh();
|
ref.current?.refresh();
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
@ -241,7 +241,7 @@ export default function SubscribeTable() {
|
|||||||
description={t('deleteWarning')}
|
description={t('deleteWarning')}
|
||||||
onConfirm={async () => {
|
onConfirm={async () => {
|
||||||
await deleteSubscribe({
|
await deleteSubscribe({
|
||||||
id: row.id,
|
id: row.id!,
|
||||||
});
|
});
|
||||||
toast.success(t('deleteSuccess'));
|
toast.success(t('deleteSuccess'));
|
||||||
ref.current?.refresh();
|
ref.current?.refresh();
|
||||||
@ -258,7 +258,7 @@ export default function SubscribeTable() {
|
|||||||
description={t('deleteWarning')}
|
description={t('deleteWarning')}
|
||||||
onConfirm={async () => {
|
onConfirm={async () => {
|
||||||
await batchDeleteSubscribe({
|
await batchDeleteSubscribe({
|
||||||
ids: rows.map((item) => item.id),
|
ids: rows.map((item) => item.id) as number[],
|
||||||
});
|
});
|
||||||
|
|
||||||
toast.success(t('deleteSuccess'));
|
toast.success(t('deleteSuccess'));
|
||||||
@ -290,7 +290,7 @@ export default function SubscribeTable() {
|
|||||||
|
|
||||||
if (changedItems.length > 0) {
|
if (changedItems.length > 0) {
|
||||||
subscribeSort({
|
subscribeSort({
|
||||||
sort: changedItems.map((item) => ({ id: item.id, sort: item.sort })),
|
sort: changedItems.map((item) => ({ id: item.id, sort: item.sort })) as API.SortItem[],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user