mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-10 04:30:25 +02:00
fix favorite column
This commit is contained in:
@@ -27,21 +27,27 @@ export const FavoriteColumn = (props: ItemTableListInnerColumn) => {
|
|||||||
size: 'md',
|
size: 'md',
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
if (!props.data?.[props.rowIndex]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (row) {
|
if (row) {
|
||||||
deleteFavorite.mutate({
|
deleteFavorite.mutate({
|
||||||
query: {
|
query: {
|
||||||
id: [(props.data as any)?.[props.rowIndex]?.id as string],
|
id: [(props.data as any)[props.rowIndex].id as string],
|
||||||
type: (props.data as any)?.[props.rowIndex]
|
type: (props.data as any)[props.rowIndex]
|
||||||
?.itemType as LibraryItem,
|
.itemType as LibraryItem,
|
||||||
},
|
},
|
||||||
|
serverId: (props.data as any)[props.rowIndex].serverId as string,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
createFavorite.mutate({
|
createFavorite.mutate({
|
||||||
query: {
|
query: {
|
||||||
id: [(props.data as any)?.[props.rowIndex]?.id as string],
|
id: [(props.data as any)[props.rowIndex].id as string],
|
||||||
type: (props.data as any)?.[props.rowIndex]
|
type: (props.data as any)[props.rowIndex]
|
||||||
?.itemType as LibraryItem,
|
.itemType as LibraryItem,
|
||||||
},
|
},
|
||||||
|
serverId: (props.data as any)[props.rowIndex].serverId as string,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user