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