mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 04:20:12 +02:00
update rating / favorite columns
This commit is contained in:
@@ -33,21 +33,27 @@ export const FavoriteColumn = (props: ItemTableListInnerColumn) => {
|
||||
|
||||
if (row) {
|
||||
deleteFavorite.mutate({
|
||||
apiClientProps: {
|
||||
serverId: (props.data as any)[props.rowIndex]
|
||||
.serverId as string,
|
||||
},
|
||||
query: {
|
||||
id: [(props.data as any)[props.rowIndex].id as string],
|
||||
type: (props.data as any)[props.rowIndex]
|
||||
.itemType as LibraryItem,
|
||||
},
|
||||
serverId: (props.data as any)[props.rowIndex].serverId as string,
|
||||
});
|
||||
} else {
|
||||
createFavorite.mutate({
|
||||
apiClientProps: {
|
||||
serverId: (props.data as any)[props.rowIndex]
|
||||
.serverId as string,
|
||||
},
|
||||
query: {
|
||||
id: [(props.data as any)[props.rowIndex].id as string],
|
||||
type: (props.data as any)[props.rowIndex]
|
||||
.itemType as LibraryItem,
|
||||
},
|
||||
serverId: (props.data as any)[props.rowIndex].serverId as string,
|
||||
});
|
||||
}
|
||||
}}
|
||||
|
||||
@@ -24,11 +24,12 @@ export const RatingColumn = (props: ItemTableListInnerColumn) => {
|
||||
const item = props.data[props.rowIndex] as any;
|
||||
|
||||
setRatingMutation.mutate({
|
||||
apiClientProps: { serverId: item.serverId as string },
|
||||
query: {
|
||||
item: [item],
|
||||
id: [item.id],
|
||||
rating: newRating,
|
||||
type: item.itemType,
|
||||
},
|
||||
serverId: item.serverId as string,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user